Class JcsmpSessionService
java.lang.Object
org.apache.beam.sdk.io.solace.broker.SessionService
org.apache.beam.sdk.io.solace.broker.JcsmpSessionService
- All Implemented Interfaces:
Serializable
A class that manages a connection to a Solace broker using basic authentication.
This class provides a way to connect to a Solace broker and receive messages from a queue.
- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.io.solace.broker.SessionService
DEFAULT_VPN_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Gracefully closes the connection to the service.voidconnect()Establishes a connection to the service.static JcsmpSessionServicecreate(JCSMPProperties jcsmpProperties, Queue queue) getInitializedProducer(SolaceIO.SubmissionMode submissionMode) Returns a MessageProducer object for publishing messages to Solace.Returns theQueue<Solace.PublishResult>instance associated with this session, with the asynchronously received callbacks from Solace for message publications.Returns a MessageReceiver object for receiving messages from Solace.Override this method and provide your specific properties, including all those related to authentication, and possibly others too.Methods inherited from class org.apache.beam.sdk.io.solace.broker.SessionService
equals, hashCode, initializeWriteSessionProperties
-
Constructor Details
-
JcsmpSessionService
public JcsmpSessionService()
-
-
Method Details
-
create
-
getSessionProperties
Description copied from class:SessionServiceOverride this method and provide your specific properties, including all those related to authentication, and possibly others too.The 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:
- Specified by:
getSessionPropertiesin classSessionService
-
connect
public void connect()Description copied from class:SessionServiceEstablishes a connection to the service. This could involve providing connection details like host, port, VPN name, username, and password.- Specified by:
connectin classSessionService
-
close
public void close()Description copied from class:SessionServiceGracefully closes the connection to the service.- Specified by:
closein classSessionService
-
getReceiver
Description copied from class:SessionServiceReturns a MessageReceiver object for receiving messages from Solace. If it is the first time this method is used, the receiver is created from the session instance, otherwise it returns the receiver created initially.- Specified by:
getReceiverin classSessionService
-
getInitializedProducer
Description copied from class:SessionServiceReturns a MessageProducer object for publishing messages to Solace. If it is the first time this method is used, the producer is created from the session instance, otherwise it returns the producer created initially.- Specified by:
getInitializedProducerin classSessionService
-
getPublishedResultsQueue
Description copied from class:SessionServiceReturns theQueue<Solace.PublishResult>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.- Specified by:
getPublishedResultsQueuein classSessionService
-