Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
paho:queueName[?options]

For example the following snippet reads messages from the MQTT broker installed on the same host as the Camel router:

Code Block
from("paho:some/queue").
  to("mock:test");

While the snippet below sends message to the MQTT broker:

Code Block
from("direct:test").
  to("paho:some/target/queue");

You can append query options to the URI in the following format: ?option=value&option=value&... . For example this is how to read messages from the remote MQTT broker: 

Code Block
from("paho:some/queue?brokerUrl=tcp://iot.eclipse.org:1883").
  to("mock:test");

Adding the component to the project

...

Div
classconfluenceTableSmall

Header

Java constant

Endpoint typeValue type

Description

PahoOriginalMessagePahoConstants.HEADER_ORIGINAL_MESSAGEConsumerorg.eclipse.paho.client.mqttv3.MqttMessageThe original Paho message instance received by the client.

Examples

Read messages from the MQTT broker installed on the same host as the Camel router:

Code Block
from("paho:some/queue")
.
to("mock:test");

Read messages from the remote MQTT broker: 

Code Block
from("paho:some/queue?brokerUrl=tcp://iot.eclipse.org:1883").
  to("mock:test");

Send message to the MQTT broker:

...

Include Page
Endpoint See Also
Endpoint See Also