Using the CXF stop and start commands
In some instances, there might be a need to control the state of the endpoint manually. Using the stop-endpoint
or start-endpoint
commands, we can shut down and start up a published endpoint from the command line. This is useful when testing client code to make sure that you are handling unavailable endpoints correctly.
Getting ready
Follow the steps from the Using the CXF list-endpoints command recipe.
How to do it…
Let's look at how to use the stop-endpoint
and start-endpoint
commands. Both commands require parameters for the bus and endpoint in order to know what to start or stop. The syntax for these commands looks like the following:
cxf:stop-endpoint <bus> <endpoint name> cxf:start-endpoint <bus> <endpoint name>
To stop an endpoint, follow these steps:
Use the
list-endpoints
command to get the bus ID and the name of our published endpoint. The following will be the output:Name State Address BusID ...