...
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 |
---|
class | confluenceTableSmall |
---|
|
Header | Java constant | Endpoint type | Value type | Description |
---|
PahoOriginalMessage | PahoConstants.HEADER_ORIGINAL_MESSAGE | Consumer | org.eclipse.paho.client.mqttv3.MqttMessage | The 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 |
---|
|