public interface SubscriberListener
Customer programs implement this interface to process inbound messages.
Programs instantiate their listener implementation classes, and may
store closure data in fields of the instances.
Programs then call EventQueue.addSubscriber
to associate a subscriber listener object with a subscriber object.
| Modifier and Type | Method and Description |
|---|---|
void |
messagesReceived(java.util.List<Message> messages,
EventQueue eventQueue)
Process inbound messages.
|
void messagesReceived(java.util.List<Message> messages, EventQueue eventQueue)
Programs define this callback method to process inbound
messages. EventQueue.dispatch
invokes this callback method, passing a list of messages and
the event queue.
The messages can arrive through different subscribers. The only aspect they necessarily share is that they require the same subscriber listener to process them.
Inbound messages in callback methods belong to the FTL library; programs must not destroy them.
The message objects are valid only until the callback method
returns. To extend the lifetime of a message, make a copy using
Message.mutableCopy.
Programs must not dispatch any event queue from within any callback.
eventQueue - The callback method is processing messages from this queue.messages - The list of messages to process.