...
NATS Component
Tip | ||
---|---|---|
| ||
NatsNATS is a fast and reliable messaging platform.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-nats</artifactId> <!-- use the same version as your Camel core version --> <version>x.y.z</version> </dependency> |
URI format
Code Block |
---|
nats:servers[?options] |
Where servers represents the list of nats NATS servers.
Options
Name | Default Value | Description |
---|---|---|
| null | Defines the servers the component should connect to. |
topic | null | The topic to connect subscribe/publish to. |
reconnect | true | Whether or not using to use the reconnection feature. |
pedantic | false | Whether or not running in pedantic mode (this affects performance). |
verbose | false | Whether or not running in verbose mode |
ssl | false | Wherer Whether or not using sslto use SSL |
reconnectTimeWait | 2000 | Waiting Waiting time before attempts reconnection (in milliseconds) |
maxReconnectAttempts | 3To | set the maximum time an action could take to completeSet the maximum number of reconnection attempts in case the connection is lost. |
pingInterval | 4000 | Ping interval to be aware if connection is still alive (in milliseconds) |
noRandomizeServers | false | Whether or not randomizing to randomize the order of servers for the connection attempts |
queueName | null | The Queue name if we are using nats NATS for a queue configuration (consumer). |
maxMessages | null | Stop receiving messages from a topic we are subscribing to after maxMessages (consumer). |
poolSize | 10 | The Queue name if we are using nats for a queue configuration Pool size for consumer workers (consumer). |
Headers
Name | Type | Description |
---|---|---|
natsMessageTimestamp CamelNatsMessageTimestamp | long | The timestamp of a consumed message. |
natsSubscribeSid CamelNatsSubscriptionId | Integer | The subscription Id ID of a consumer. |
Producer example:
Code Block | ||
---|---|---|
| ||
from("direct:send").to("nats://localhost:4222?topic=test"); |
...