1

我正在尝试在 tibco 集合点创建一个侦听器。我想听一个特定的主题。我知道它应该看起来像这样:

TibrvListener(
TibrvQueue queue,
TibrvMsgCallback callback,
TibrvTransport transport,
java.lang.String subject,
java.lang.Object closure)
throws TibrvException

我有这个代码。但是,我不知道几件事。如何创建TibrvMsgCallback对象?我如何通过交通工具?我有一个发布者将消息作为单独的程序发送。我是否在订阅程序中重新创建相同的传输?

queue = new TibrvQueue();
dispatcher = new TibrvDispatcher(queue);
queue.setName(key);
this.listener = new TibrvListener(queue, null, null, subject, null);
TibrvTransport message = this.listener.getTransport();
4

1 回答 1

3

You first open the Tibrv Tibrv.open(Tibrv.IMPL_NATIVE);

Create transport TibrvTransport transport = new TibrvRvdTransport(service, network, daemon);

Create Listener new TibrvListener(Tibrv.defaultQueue(), this, transport, subject, null);

If your listener is "this", your class needs to implement TibrvMsgCallback

Messages can be processed on arrival in the onMsg(TibrvListener listener, TibrvMsg msg) method.

于 2012-07-13T18:49:04.997 回答