It is to be noted that
only sendSync() is allowed for active JBI exchanges (but you have to use send() for
DONE or ERROR status exchanges). This is shown in the following code:
public interface DeliveryChannel
{
public MessageExchange accept()throws MessagingException;
public void send(MessageExchange exchange)throws
MessagingException;
public boolean sendSync(MessageExchange exchange)
throws MessagingException;
public boolean sendSync(MessageExchange exchange, long timeout)
throws MessagingException;
}
Chapter 9
[ 175 ]
Sample Use Case for Accessing JBI Bus
We will have another full sample for POJO binding to demonstrate how to access
the JBI bus from within a POJO. As described above, we can use ComponentContext
to access the DeliveryChannel to send messages to the JBI bus. Another way to
interact with the JBI bus is to use the client API. Let us define a sample use case to
access the JBI bus.
We will have the following components to implement the sample use case:
Client
HTTP binding
JSR POJO Bridge
JSR POJO Destination
These components are integrated as shown in the following figure.
Pages:
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253