public abstract class JcsmpSessionService extends SessionService
This class provides a way to connect to a Solace broker and receive messages from a queue.
DEFAULT_VPN_NAME| Constructor and Description |
|---|
JcsmpSessionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Gracefully closes the connection to the service.
|
void |
connect()
Establishes a connection to the service.
|
static JcsmpSessionService |
create(JCSMPProperties jcsmpProperties,
Queue queue) |
MessageProducer |
getInitializedProducer(SolaceIO.SubmissionMode submissionMode)
Returns a MessageProducer object for publishing messages to Solace.
|
java.util.Queue<Solace.PublishResult> |
getPublishedResultsQueue()
Returns the
Queue instance associated with this session, with the
asynchronously received callbacks from Solace for message publications. |
MessageReceiver |
getReceiver()
Returns a MessageReceiver object for receiving messages from Solace.
|
JCSMPProperties |
getSessionProperties()
Override this method and provide your specific properties, including all those related to
authentication, and possibly others too.
|
equals, hashCode, initializeWriteSessionPropertiespublic static JcsmpSessionService create(JCSMPProperties jcsmpProperties, @Nullable Queue queue)
public JCSMPProperties getSessionProperties()
SessionServiceThe method will be used whenever the session needs to be created or refreshed. If you are setting credentials with expiration, just make sure that the latest available credentials (e.g. renewed token) are set when the method is called.
For a list of all the properties that can be set, please check the following link:
getSessionProperties in class SessionServicepublic void connect()
SessionServiceconnect in class SessionServicepublic void close()
SessionServiceclose in class SessionServicepublic MessageReceiver getReceiver()
SessionServicegetReceiver in class SessionServicepublic MessageProducer getInitializedProducer(SolaceIO.SubmissionMode submissionMode)
SessionServicegetInitializedProducer in class SessionServicepublic java.util.Queue<Solace.PublishResult> getPublishedResultsQueue()
SessionServiceQueue instance associated with this session, with the
asynchronously received callbacks from Solace for message publications. The queue
implementation has to be thread-safe for production use-cases.getPublishedResultsQueue in class SessionService