user10608: I want to publish sensor data to server using MQTT protocol via GPRS/GSM modem. 
I googled MQTT for Arduino, AQTT Arduino available only for Ethernet shield or will MQTT Arduino Ethernet shield work in GSM modem?

user14642: Nick O'leary published an MQTT client for Arduino.
I use it extensively.  You can find it here: http://knolleary.net/arduino-client-for-mqtt/.
Once you have established a tcpip connection you can use this library to send/receive via the MQTT protocol across a GPRS/GSM modem.  I have used it successfully on:

the Arduino GSM shield 
the Seeeduino GPRS IoT panel 
a Freetronics Arduino Mega connecting via ethernet to a TPLink MR3020 router


user24064: Arduino MQTT Library for SIM800 (and SIM900) GSM Modem is available at ElementzTechBlog, ElementzGithubRepository
Functionalities:
Auto connect

Automatically connect to TCP and to MQTT server.

connect function

This function can be used to connect your client to MQTT broker.
Use only if you do not use Auto connect functionality.
Optionally  you can use username, password, WILL topic and WILL
Message.

OnConnect CallBack function

This call back function is called when MQTT connection is
established.
You can call subscription and publish functions inside it (according to your need).

publish function
 - This function can be used to publish messages to different topics.   

You can select  QoS levels and RETAIN flag according to your need.

subscribe function

This function can be used to subscribe messages from different
topics.

OnMessage CallBack function

This callback function is called when messages are received from 
subscribed topics
Topic, TopicLength, Message, MessageLength are the arguments of 
OnMessage callback function.
Inside this, you can write your custom code.

unsubscribe function

This function can be used to unsubscribe from a previously subscribed
topic.

disconnect function

This function can be used to disconnect your client from MQTT broker.

Keep Alive

You can specify your KeepAlive duration while initializing.
Ping requests are sent and received automatically.

Subscribe Publish examples are also provided.

10608: <p>I want to publish sensor data to server using MQTT protocol via GPRS/GSM modem. </p>

<p>I googled MQTT for Arduino, AQTT Arduino available only for Ethernet shield or will MQTT Arduino Ethernet shield work in GSM modem?</p>
 14642: <p>Nick O'leary published an MQTT client for Arduino.
I use it extensively.  You can find it here: <a href="http://knolleary.net/arduino-client-for-mqtt/" rel="nofollow">http://knolleary.net/arduino-client-for-mqtt/</a>.<br>
Once you have established a tcpip connection you can use this library to send/receive via the MQTT protocol across a GPRS/GSM modem.  I have used it successfully on:</p>

<ul>
<li>the Arduino GSM shield </li>
<li>the Seeeduino GPRS IoT panel </li>
<li>a Freetronics Arduino Mega connecting via ethernet to a TPLink MR3020 router</li>
</ul>
 24064: <p>Arduino MQTT Library for SIM800 (and SIM900) GSM Modem is available at <a href="https://elementztechblog.wordpress.com/2016/07/18/arduino-mqtt-library-for-sim800-gsm-modem/" rel="nofollow">ElementzTechBlog</a>, <a href="https://github.com/elementzonline/SIM800_MQTT" rel="nofollow">ElementzGithubRepository</a></p>

<p><strong>Functionalities:</strong></p>

<p><strong>Auto connect</strong></p>

<ul>
<li>Automatically connect to TCP and to MQTT server.</li>
</ul>

<p><strong>connect function</strong></p>

<ul>
<li>This function can be used to connect your client to MQTT broker.</li>
<li>Use only if you do not use Auto connect functionality.</li>
<li>Optionally  you can use username, password, WILL topic and WILL
Message.</li>
</ul>

<p><strong>OnConnect CallBack function</strong></p>

<ul>
<li><p>This call back function is called when MQTT connection is
established.</p></li>
<li><p>You can call subscription and publish functions inside it (according to your need).</p></li>
</ul>

<p><strong>publish function</strong>
 - This function can be used to publish messages to different topics.   </p>

<ul>
<li>You can select  QoS levels and RETAIN flag according to your need.</li>
</ul>

<p><strong>subscribe function</strong></p>

<ul>
<li>This function can be used to subscribe messages from different
topics.</li>
</ul>

<p><strong>OnMessage CallBack function</strong></p>

<ul>
<li><p>This callback function is called when messages are received from 
subscribed topics</p></li>
<li><p>Topic, TopicLength, Message, MessageLength are the arguments of 
OnMessage callback function.</p></li>
<li><p>Inside this, you can write your custom code.</p></li>
</ul>

<p><strong>unsubscribe function</strong></p>

<ul>
<li>This function can be used to unsubscribe from a previously subscribed
topic.</li>
</ul>

<p><strong>disconnect function</strong></p>

<ul>
<li>This function can be used to disconnect your client from MQTT broker.</li>
</ul>

<p><strong>Keep Alive</strong></p>

<ul>
<li><p>You can specify your KeepAlive duration while initializing.</p></li>
<li><p>Ping requests are sent and received automatically.</p></li>
</ul>

<p><strong>Subscribe Publish examples are also provided.</strong></p>
