Show TOC Anfang des Inhaltsbereichs

Diese Grafik wird im zugehörigen Text erklärt Closing the JMS Connection Dokument im Navigationsbaum lokalisieren

Use

You perform this operation when you want to finish using the JMS connection, and the objects used must be released. This means that the Session and the Connection that are created must be closed. You can choose one of two ways: manually close the Session and then the Connection, or close the Connection object only. In the second case, the JMS provider automatically closes the Session.

Procedure

When the connection is closed, the session object and all the connection objects used are released. If you are using point-to-point connection use the following code to close the Connection object:

Syntax

// Close the queue connection

queueConnection.close();

If you are using the publish-subscribe connection, close the Connection in the same way:

Syntax

// Close the topic connection

topicConnection.close();

Result

The JMS connection is closed and the Session is automatically stopped.

 

 

Ende des Inhaltsbereichs