Reputation: 14875
Sometimes i need to send a message to a channel, i don't care if the channel has any members and the message gets lost.
Is it possible to send a message to a channel without joining it?
Upvotes: 0
Views: 233
Reputation: 2186
You could use a stack that has only UDP
(and perhaps UNICAST3
) in it, but you'd still have to join it. Or you could mark the message as NO_FC | NO_RELIABILITY
and that would skip retransmission and lossless protocols such as NAKACK2
and UNICAST3
. However, you'd still have to join.
A way to send a message to a cluster without joining it (e.g. creating a channel and connecting it) is to make every channel listen for external communication, e.g. via a TCP socket. The STOMP
protocol [1] is an example of such a protocol, but of course any type of communication (REST, binary etc) would work. In this case, however, the messages reveived over a STOMP socket are sent with whatever properties the cluster channel has.
[1] http://www.jgroups.org/manual4/index.html#STOMP
Upvotes: 1