You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Vishnu Vardhan <pb...@gmail.com> on 2017/11/16 04:49:19 UTC
Not able to publish new topic - MQTT
Hi,
I'm trying to use MQTT component for publishing a topic(custom) and
subscribe it back using camel. But when i try to publish message in a new
topic using mqtt, the message is sent through only the default
topic(camel/mqtt/test).
Here is how i'm publishing:-
After creating publisher template object,
template.sendBody("mqtt:test?host=tcp://HostID:port?publishTopicName=topicname",
"Test Message: " + "Hello!!!");
This is how i'm subscribing,
public void configure() throws Exception {
from("mqtt:test?host=tcp://HostID:port?
subscribeTopicNames=topicname")
.to("stream:out");
}
Please let me know that how to publish my own topic.
Thanks,
Vishnu
Re: Not able to publish new topic - MQTT
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
What version of Camel are you using?
On Thu, Nov 16, 2017 at 5:49 AM, Vishnu Vardhan
<pb...@gmail.com> wrote:
> Hi,
>
> I'm trying to use MQTT component for publishing a topic(custom) and
> subscribe it back using camel. But when i try to publish message in a new
> topic using mqtt, the message is sent through only the default
> topic(camel/mqtt/test).
>
> Here is how i'm publishing:-
>
> After creating publisher template object,
>
> template.sendBody("mqtt:test?host=tcp://HostID:port?publishTopicName=topicname",
> "Test Message: " + "Hello!!!");
>
> This is how i'm subscribing,
>
> public void configure() throws Exception {
> from("mqtt:test?host=tcp://HostID:port?
> subscribeTopicNames=topicname")
> .to("stream:out");
> }
>
> Please let me know that how to publish my own topic.
>
>
> Thanks,
> Vishnu
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2