The subscribe Task
subscribe is a queue subscription task.
Configuration options
topic-
topicis the name of the message queue topic to subscribe to. Alias:subject.Required for subscribe with type
natsandstan. Ignored with other types. (seetypeoption below).+ For example, subscribe to
myqueue:
topic:myqueue
type-
typedetermines what updstream message queue to use. If unspecified, it will use the same queue the agent is configured to use (by default NATS). Supported values arenats,stan,tcpandhttp.-
nats: will subscribe to a NATS queue. -
stan: will subscribe to a NATS Streaming queue.For example, to subscribe to
Nats Streamingon topic ofmytopic:type:stan;topic:mytopic -
http: will listen start an HTTP Server ataddr(seeaddroption below). The message will be receive as the body of an HTTP POST from a client. Headers are ignored.httpsis not supported.For example, to receive a HTTP POST requests for each message on
http://localhost:78945:type:http;addr:http://localhost:78945 -
tcp: will listen on a TCP connection. It will receive each message separated by a new line seperator (\n).For example, to receive messages on a TCP connection at
localhost:57412:type:tcp;addr:localhost:57412
-
addr-
addris the endpoint for the messages subscription. The format of this field depends on thetype:-
http: this is the fully qualified HTTP address.
E.g.http://localhost:78945
By default,addrishttp://localhost:8888fortype: http.type:http;addr:http://localhost:78945 -
tcp: this is the full TCP address with domain/IP and port.
E.g.127.0.0.1:8745.
By default,addrislocalhost:9090fortype: tcp.type:tcp;addr:localhost:5174
-