You will have to create a custom method sensor for the put method. In the rule that the method sensor creates you must enable capturing of return value. The returned value will be a representation of the object type the return value belongs to (for example if you will have a Object type return, it will most likely return an internal ID of the object); so if you need to use another method on the return in order to get a relevant value (such as .getName() or .toString() or any other applicable method) this can be added in the accessor field.
This can be done either by right clicking your system profile, choosing Edit System Profile, then from the list on the left choosing Sensors, Browse, and finding the method in the generated list:
Or by right clicking the method from within a PurePath tree, and choosing option "add sensor rule" followed by "Include selected methods...".
Once the method rule is created, just make sure to check the box for return value and add any accessor method required to capture the value in a relevant way:
Let me know if you have any other queries.
Babar, I have looked up the javadoc for the class (http://www.ibm.com/support/knowledgecenter/SSFKSJ_...
The put(MQMessage, MQPutMessageOptions) method is of type void, meaning that it doesn't return anything.
Is this messageId an attribute of the MQMessage argument of the put method instead of its return?
I see on the docs that this MessageId is a String property of the MQMessage class.
So, to capture this, please try the following:
- disable the 'Method return values will be captured' - there are no return values
- in the list of arguments, next to "com.ibm.mq.MQMessage", check the box in the column called "Capture", and next to it in the accessor field write ".getStringProperty("MessageId")"