Your CMP application
hangs if the broker is not available
Scenario: When the broker is unavailable, the CMP application hangs.
Explanation: Communication between the CMP and the broker is asynchronous,
therefore the CMP hangs because
it is waiting for a message from the broker.
Solution: Configure the maximum amount of time that
the CMP waits by using the
following method:
// Wait for a maximum of 10 seconds
BrokerProxy.setRetryCharacteristics(10000);
The
value specified represents the time in milliseconds that the CMP will wait for information before
throwing the BrokerProxyPropertyNotInitializedException exception.
If
you set this timeout value too low, an exception is thrown, even if
the broker is available.
You set a property of an object and query its value, but the
value has not changed
Scenario: You have set a property of an object,
then queried its value; the value has not changed.
Explanation: Methods that change properties of broker
objects are not processed immediately. If you call a property change
method on a CMP object, the CMP sends a message that requests
the specified change to the broker. The broker processes the request
asynchronously, and notifies all AdministeredObjectListeners of
the affected object when the change has been attempted.
Solution: Methods that change state typically return
to the calling program as soon as the request has been put to the
queue manager of the broker, or, following a call to BrokerProxy.beginUpdates(),
as soon as the request has been added to the current batch. If the
property has still not been updated after the action's response to
the request has been returned to the application, consult the response
message for more details.
You cannot connect to a broker when using a .broker file
Scenario: You cannot connect to a broker when you
use a .broker file.
Explanation: If your CMP applications use the MQPropertyFileBrokerConnectionParameters class,
they can connect to a broker by using a connection file that has a .broker extension.
However, this file can be parsed only if an XML parser is available.
Solution: Ensure that a supported parser is available
on the CLASSPATH. A supported parser is shipped with IBM Integration Bus.
Alternatively,
your application can use the MQBrokerConnectionParameters class
instead of the MQPropertyFileBrokerConnectionParameters class.
This class connects to a broker by specifying the host name, queue
manager name, and queue manager port of the target broker directly.
This method does not require an XML parser.