Is it possible to have a callback while sending Tbrv msg using TibRvdTransport->send(msg)
and in subscriber can we send a reply ?
I want to send "Hello" from publisher and receiver should receieve it and send "Hi" reply. Publisher must get this "Hi" in callback and print it.
Publisher=>
TibrvRvdTrasport transport= new TibrvRvdTrasport ("12000","127.0.0.1","6000");
TibrvMsg tibMsg = new TibrvMsg();
tibMsg.add("msg" "hello");
tibMsg.setSendSubject(subject);
transport.send(tibMsg);
Subscriber=>
listener = new TibRvListener(tibRvQueue, new TibRvMsgCallback(){
@Override
public void onMsg(TibRvListener listener,TibRvMsg msg){
try{
-----//sendReply("Hi")
}
catch(Exception e){
}
},
new TibRvdTransport("12000","127.0.0.1","6000")),subject,null);
Sure, here's one way of doing this. Typically you create a private 'inbox' subject that is used as reply subject on the original request. This 'inbox' is just a simple unique string. It could be anything (also "REPLY"), but it's useful to have a unique one in most cases.
Sender side:
And receiver side: