public interface AbstractSession
Modifier and Type | Method and Description |
---|---|
Queue |
getQueue(Uri uri,
long flags,
QueueEventHandler handler,
AckMessageHandler ackHandler,
PushMessageHandler pushHandler)
Create a queue representation.
|
boolean |
isStarted()
Check if the 'Session' is started
|
void |
linger()
Shutdown all connection and event handling threads.
|
void |
start(Duration timeout)
Connect to the BlazingMQ broker and start the message processing
|
void |
startAsync(Duration timeout)
Connect to the BlazingMQ broker and start the message processing
|
void |
stop(Duration timeout)
Gracefully disconnect from the BlazingMQ broker and stop the operation of this 'Session'.
|
void |
stopAsync(Duration timeout)
Gracefully disconnect from the BlazingMQ broker and stop the operation of this 'Session'.
|
void start(Duration timeout)
This method blocks until either the 'Session' is connected to the broker, fails to connect, or the operation times out.
timeout
- start timeout valueBMQException
- if start attempt failedvoid startAsync(Duration timeout)
This method returns without blocking. The result of the operation is communicated with a session event. If the optionally specified 'timeout' is not populated, use the one defined in the session options.
timeout
- start timeout valueBMQException
- in case of failureboolean isStarted()
void stop(Duration timeout)
This method blocks waiting for all already invoked event handlers to exit and all session-related operations to be finished.
timeout
- stop timeout valueBMQException
- if stop attempt failedvoid stopAsync(Duration timeout)
This method returns without blocking. The result of the operation is communicated with a session event. If the optionally specified 'timeout' is not populated, use the one defined in the session options.
timeout
- stop timeout valueBMQException
- in case of failurevoid linger()
This method must be called when the Session
is stopped. No other method may be
used after this method returns.
Queue getQueue(Uri uri, long flags, QueueEventHandler handler, AckMessageHandler ackHandler, PushMessageHandler pushHandler)
Returned Queue
may be in any state.
uri
- URI of the created Queue
, immutableflags
- a combination of the values defined in QueueFlags
handler
- queue event handler callback interfaceackHandler
- callback handler for incoming ACK events, can be null if only consumerpushHandler
- callback handler for incoming PUSH events, can be null if only producerIllegalArgumentException
- in case of a wrong combination of the queue flags and the
handlersBMQException
- for any other unrecoverable errorsQueueFlags
Copyright © 2023 Bloomberg L.P.. All rights reserved.