MQTT producer failure

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

MQTT producer failure

Tomohisa Igarashi
Hi,

I'm still struggling with camel-mqtt producer to get it working. This
is a previous thread:
http://camel.465427.n5.nabble.com/Dispatch-queue-mqtt-client-was-not-executing-error-from-camel-mqtt-producer-tp5753937.html

I made an example which runs a standalone camel route to verify
camel-mqtt works as expected:
https://github.com/igarashitm/camel/tree/mqtt-consumer-producer-failure
https://github.com/igarashitm/camel/commit/24bdf5c7f8bac5763f2485591561773bba4e337f

But it hits an another issue on producer side. A message is never
published to the output topic through the MQTT producer and it repeats
redeliveries without any error/warn message unless the testcase is
shut down.

Am I doing something wrong in the testcase? If not, I'll file a JIRA
with this example.

Thanks,
Tomo
--
IGARASHI Tomohisa    mailto:[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: MQTT producer failure

Tomohisa Igarashi
Just one step forward on this example...

The culprit is "MQTTTopicPropertyName" exchange property which is set
by MQTT consumer. MQTT producer send a message to the topic specified
by this property if it exists and ignore the publishTopicName. It
means publishTopicName is ignored if MQTT consumer exists in the
route, then MQTT producer send a message to the topic which is
subscribed by MQTT consumer. That's why this example went into
infinite loop.

Now a message is published to the output topic through camel-mqtt
producer, but I found ActiveMQ server delays 15 seconds to accept that
PUBLISH message, whereas the PUBLISH message sent by the test code is
accepted immediately. I saw the packet arrives at ActiveMQ mqtt port
immediately with using tcpdump, but ActiveMQ doesn't respond until it
passes 15 seconds. It seems like there's a timer or something.

Here is a log including some trace log I added with Byteman.
http://pastebin.com/d3wAq593
L136, L137: The test code send a PUBLISH and is immediately accepted by ActiveMQ
L167, L168, L169: The camel-mqtt producer send a PUBLISH but it takes
15 seconds to be accepted by ActiveMQ

Any comment would be highly appreciated.

Thanks,
Tomo
--
IGARASHI Tomohisa    mailto:[hidden email]


On Tue, Aug 5, 2014 at 6:04 PM, Tomohisa Igarashi <[hidden email]> wrote:

> Hi,
>
> I'm still struggling with camel-mqtt producer to get it working. This
> is a previous thread:
> http://camel.465427.n5.nabble.com/Dispatch-queue-mqtt-client-was-not-executing-error-from-camel-mqtt-producer-tp5753937.html
>
> I made an example which runs a standalone camel route to verify
> camel-mqtt works as expected:
> https://github.com/igarashitm/camel/tree/mqtt-consumer-producer-failure
> https://github.com/igarashitm/camel/commit/24bdf5c7f8bac5763f2485591561773bba4e337f
>
> But it hits an another issue on producer side. A message is never
> published to the output topic through the MQTT producer and it repeats
> redeliveries without any error/warn message unless the testcase is
> shut down.
>
> Am I doing something wrong in the testcase? If not, I'll file a JIRA
> with this example.
>
> Thanks,
> Tomo
> --
> IGARASHI Tomohisa    mailto:[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: MQTT producer failure

Claus Ibsen-2
Hi

Yeah sounds like a bug. Feel free to log a JIRA ticket.

We should do like in camel-jms where we a header that is prefixed with
CamelJmsDestination as the control header to send to another
destination. And we do not propagate that header across. See the
source code for JmsProducer etc.

On Sat, Aug 9, 2014 at 6:52 AM, Tomohisa Igarashi <[hidden email]> wrote:

> Just one step forward on this example...
>
> The culprit is "MQTTTopicPropertyName" exchange property which is set
> by MQTT consumer. MQTT producer send a message to the topic specified
> by this property if it exists and ignore the publishTopicName. It
> means publishTopicName is ignored if MQTT consumer exists in the
> route, then MQTT producer send a message to the topic which is
> subscribed by MQTT consumer. That's why this example went into
> infinite loop.
>
> Now a message is published to the output topic through camel-mqtt
> producer, but I found ActiveMQ server delays 15 seconds to accept that
> PUBLISH message, whereas the PUBLISH message sent by the test code is
> accepted immediately. I saw the packet arrives at ActiveMQ mqtt port
> immediately with using tcpdump, but ActiveMQ doesn't respond until it
> passes 15 seconds. It seems like there's a timer or something.
>
> Here is a log including some trace log I added with Byteman.
> http://pastebin.com/d3wAq593
> L136, L137: The test code send a PUBLISH and is immediately accepted by ActiveMQ
> L167, L168, L169: The camel-mqtt producer send a PUBLISH but it takes
> 15 seconds to be accepted by ActiveMQ
>
> Any comment would be highly appreciated.
>
> Thanks,
> Tomo
> --
> IGARASHI Tomohisa    mailto:[hidden email]
>
>
> On Tue, Aug 5, 2014 at 6:04 PM, Tomohisa Igarashi <[hidden email]> wrote:
>> Hi,
>>
>> I'm still struggling with camel-mqtt producer to get it working. This
>> is a previous thread:
>> http://camel.465427.n5.nabble.com/Dispatch-queue-mqtt-client-was-not-executing-error-from-camel-mqtt-producer-tp5753937.html
>>
>> I made an example which runs a standalone camel route to verify
>> camel-mqtt works as expected:
>> https://github.com/igarashitm/camel/tree/mqtt-consumer-producer-failure
>> https://github.com/igarashitm/camel/commit/24bdf5c7f8bac5763f2485591561773bba4e337f
>>
>> But it hits an another issue on producer side. A message is never
>> published to the output topic through the MQTT producer and it repeats
>> redeliveries without any error/warn message unless the testcase is
>> shut down.
>>
>> Am I doing something wrong in the testcase? If not, I'll file a JIRA
>> with this example.
>>
>> Thanks,
>> Tomo
>> --
>> IGARASHI Tomohisa    mailto:[hidden email]



--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [hidden email]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Reply | Threaded
Open this post in threaded view
|

Re: MQTT producer failure

Tomohisa Igarashi
Hi Claus,

Thanks for the comment, filed it -
https://issues.apache.org/jira/browse/CAMEL-7673
I'll give it a shot.

Thanks,
Tomo

--
IGARASHI Tomohisa    mailto:[hidden email]


On Sat, Aug 9, 2014 at 3:34 PM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> Yeah sounds like a bug. Feel free to log a JIRA ticket.
>
> We should do like in camel-jms where we a header that is prefixed with
> CamelJmsDestination as the control header to send to another
> destination. And we do not propagate that header across. See the
> source code for JmsProducer etc.
>
> On Sat, Aug 9, 2014 at 6:52 AM, Tomohisa Igarashi <[hidden email]> wrote:
>> Just one step forward on this example...
>>
>> The culprit is "MQTTTopicPropertyName" exchange property which is set
>> by MQTT consumer. MQTT producer send a message to the topic specified
>> by this property if it exists and ignore the publishTopicName. It
>> means publishTopicName is ignored if MQTT consumer exists in the
>> route, then MQTT producer send a message to the topic which is
>> subscribed by MQTT consumer. That's why this example went into
>> infinite loop.
>>
>> Now a message is published to the output topic through camel-mqtt
>> producer, but I found ActiveMQ server delays 15 seconds to accept that
>> PUBLISH message, whereas the PUBLISH message sent by the test code is
>> accepted immediately. I saw the packet arrives at ActiveMQ mqtt port
>> immediately with using tcpdump, but ActiveMQ doesn't respond until it
>> passes 15 seconds. It seems like there's a timer or something.
>>
>> Here is a log including some trace log I added with Byteman.
>> http://pastebin.com/d3wAq593
>> L136, L137: The test code send a PUBLISH and is immediately accepted by ActiveMQ
>> L167, L168, L169: The camel-mqtt producer send a PUBLISH but it takes
>> 15 seconds to be accepted by ActiveMQ
>>
>> Any comment would be highly appreciated.
>>
>> Thanks,
>> Tomo
>> --
>> IGARASHI Tomohisa    mailto:[hidden email]
>>
>>
>> On Tue, Aug 5, 2014 at 6:04 PM, Tomohisa Igarashi <[hidden email]> wrote:
>>> Hi,
>>>
>>> I'm still struggling with camel-mqtt producer to get it working. This
>>> is a previous thread:
>>> http://camel.465427.n5.nabble.com/Dispatch-queue-mqtt-client-was-not-executing-error-from-camel-mqtt-producer-tp5753937.html
>>>
>>> I made an example which runs a standalone camel route to verify
>>> camel-mqtt works as expected:
>>> https://github.com/igarashitm/camel/tree/mqtt-consumer-producer-failure
>>> https://github.com/igarashitm/camel/commit/24bdf5c7f8bac5763f2485591561773bba4e337f
>>>
>>> But it hits an another issue on producer side. A message is never
>>> published to the output topic through the MQTT producer and it repeats
>>> redeliveries without any error/warn message unless the testcase is
>>> shut down.
>>>
>>> Am I doing something wrong in the testcase? If not, I'll file a JIRA
>>> with this example.
>>>
>>> Thanks,
>>> Tomo
>>> --
>>> IGARASHI Tomohisa    mailto:[hidden email]
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [hidden email]
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/