Pausing and resuming a Liberty server from the command line
You can use the server pause or server resume commands to pause and then resume inbound work for a Liberty server. By pausing and resuming inbound work, you can isolate resources for auditing or debugging purposes without having to stop the server.
About this task
The following components can be paused:
- HTTP endpoints
When you pause one or more HTTP endpoints, you can isolate one or more resources that are associated with particular HTTP endpoints. The resource can be a database, for example.
To pause or resume specific endpoints, specify the ID of each
httpEndpoint
element from the configuration on the --target option of the server command. For example, you can pause the db1HttpEndpoint endpoint and the db2HttpEndpoint endpoint that are in the following configuration:<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="8800" httpsPort="8810"/> <httpEndpoint id="db1HttpEndpoint" host="*" httpPort="8801" httpsPort="8811"/> <httpEndpoint id="db2HttpEndpoint" host="*" httpPort="8802" httpsPort="8812"/>
To pause the endpoints, issue the following command:
server pause server_name --target=db1HttpEndpoint,db2HttpEndpoint
If the endpoints are configured to process HTTP requests and SSL secured HTTPS requests, pausing and resuming an endpoint applies to both communication types.
- Message endpoints
You can pause message-driven bean (MDB) message endpoints to prevent the endpoint from receiving messages.
To pause or resume specific message endpoints, specify the activation name of each MDB message endpoint on the --target option of the server command. The activation name is constructed in the following format:
ApplicationName#ModuleName#BeanName
For example, to pause an MDB message endpoint, issue the following command:
server pause server_name --target=MDBApplication#MDBModule.jar#Bean