You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Jinesh M.K" <mk...@gmail.com> on 2013/05/23 14:42:30 UTC

Problem in mqtt Component

Hi,

I have some problem with mqtt end point using spring DSL. Here my route
definition



        <camel:route>
            <camel:from
uri="mqtt:foo?host=tcp://myhost:1883&amp;subscribeTopicName=test/#" />
            <camel:to
uri="mqtt:bar?host=tcp:/myhost:1883&amp;publishTopicName=test1/test" />
            <camel:log message="Message processed" />
        </camel:route>

Using this route definition, the program taking long time to print the log
message and nothing is published under test1/test topic. If I remove any
one the mqtt route. It will works fine. For example

          <camel:route>
            <camel:from
uri="mqtt:foo?host=tcp://myhost:1883&amp;subscribeTopicName=test/#" />
            <camel:to uri="file:/myhome/test" />
            <camel:log message="Message processed" />
        </camel:route>

or

  <camel:route>
            <camel:from uri="file:/myhome/test" />
            <camel:to
uri="mqtt:bar?host=tcp:/myhost:1883&amp;publishTopicName=test1/test" />
            <camel:log message="Message processed" />
        </camel:route>

Both these condition works fine. Problem only using mqtt in from and to
route.

Any idea about it?

Thanks in advance
-- 
Jinesh M.K
 <mk...@gmail.com>

Re: Problem in mqtt Component

Posted by Robert Davies <ra...@gmail.com>.
The mqtt client does (or should) support publishing - the polling feeds is the type of consumption - a poll as opposed to asynchronous delivery from the underlying matt-client implementation
Could you raise a jira (with a test case) so we can track the issue ?

thanks,

Rob
On 11 Feb 2014, at 18:25, Zadko <za...@gmail.com> wrote:

> I am working on doing the exact same thing; consuming from a topic and
> publishing to another. The consuming works fine however nothing gets
> published. I was made aware of the following note of the doc 
> http://camel.apache.org/mqtt.html <http://camel.apache.org/mqtt.html>  
> 
> Note: The component currently only supports polling (consuming) feeds.
> 
> It makes me wonder why the component would include a publishTopicName option
> if it doesnt support publishing messages. I am doing some further digging on
> this.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-in-mqtt-Component-tp5733027p5747127.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Rob Davies
————————
Red Hat, Inc
Twitter: rajdavies
Blog: http://rajdavies.blogspot.com
ActiveMQ in Action: http://www.manning.com/snyder/


Re: Problem in mqtt Component

Posted by Zadko <za...@gmail.com>.
I am working on doing the exact same thing; consuming from a topic and
publishing to another. The consuming works fine however nothing gets
published. I was made aware of the following note of the doc 
http://camel.apache.org/mqtt.html <http://camel.apache.org/mqtt.html>  

Note: The component currently only supports polling (consuming) feeds.

It makes me wonder why the component would include a publishTopicName option
if it doesnt support publishing messages. I am doing some further digging on
this.



--
View this message in context: http://camel.465427.n5.nabble.com/Problem-in-mqtt-Component-tp5733027p5747127.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem in mqtt Component

Posted by Robert Davies <ra...@gmail.com>.
Hi Jinesh,

which MQTT broker are you running and which version ? It looks like the client isn't able to connect for some reason.
Also - which version of Apache Camel are you using ?

thanks,

Rob

On 23 May 2013, at 13:42, Jinesh M.K <mk...@gmail.com> wrote:

> Hi,
> 
> I have some problem with mqtt end point using spring DSL. Here my route
> definition
> 
> 
> 
>        <camel:route>
>            <camel:from
> uri="mqtt:foo?host=tcp://myhost:1883&amp;subscribeTopicName=test/#" />
>            <camel:to
> uri="mqtt:bar?host=tcp:/myhost:1883&amp;publishTopicName=test1/test" />
>            <camel:log message="Message processed" />
>        </camel:route>
> 
> Using this route definition, the program taking long time to print the log
> message and nothing is published under test1/test topic. If I remove any
> one the mqtt route. It will works fine. For example
> 
>          <camel:route>
>            <camel:from
> uri="mqtt:foo?host=tcp://myhost:1883&amp;subscribeTopicName=test/#" />
>            <camel:to uri="file:/myhome/test" />
>            <camel:log message="Message processed" />
>        </camel:route>
> 
> or
> 
>  <camel:route>
>            <camel:from uri="file:/myhome/test" />
>            <camel:to
> uri="mqtt:bar?host=tcp:/myhost:1883&amp;publishTopicName=test1/test" />
>            <camel:log message="Message processed" />
>        </camel:route>
> 
> Both these condition works fine. Problem only using mqtt in from and to
> route.
> 
> Any idea about it?
> 
> Thanks in advance
> -- 
> Jinesh M.K
> <mk...@gmail.com>