Let’s say I have a queue processor that processes thousands of items and I want to log the key/item id of these messages, how I can do it? I tried logging pzMessageID, but that’s not working. I also tried logging full XML of the page but it doesn’t contain any info other than what I queued. I have param.pxItemId when I queued it and I want to use this ID to see if it’s processed or not, using logs.
@abhijith_telstra can you call your queue processor from the flow utility shape(Run in background shape)?
Found a solution from the following article and wrote a function. AttributeName is input param to this function.
String QPMsgID = "";
PublicAPI papi = ThreadContainer.get().getPublicAPI();
ParameterPage ppg= papi.getParameterPage();
ClipboardPage cpg = ppg.getPage("pzExecutionMetadata");
QPMsgID=cpg.getString(AttributeName);
return QPMsgID;
@abhijith_telstra attributeName you are passing here is pxItemID?
@AnoopK12 No, it’s the property name such as pzAttempts or pzMessageID. Here’s how raw data of param.pzExecutionMetadata looks like.
page "<unnamed>" of class "System-Message-QueueProcessor-DelayedItem", 9/10 props expanded expanded properties: -pyInitialInterval = "1" -pyIntervalFactor = "2.0" -pyIsDelayedProperty = "true" -pyMaxAttempts = "5" -pzAcquireLockAttempts = "0" -pzAttempts = "0" -pzMessageID = "12e39823-33f7-439c-aa5b-5daaa26d4b36" -pzQueueProcessorName = "GenericQueueProcessor" -pzTimeForProcessing = "20230224T101742.850 GMT"
@abhijith_telstra Ok thank you. So you are passing pzMessageID as the AttributeName to the function and setting that to QPMsgID and returning that value so that it will be available in the activity for further usage. Similarly if need pzAttempts, we can pass pzAttempts as the parameter(AttributeName) to the function. Is my understanding correct? And the queued item will be having the returned value from function, for eg:- if its QpMsgID, you will be able to identify the queued item using pxitemID and the QPMsgID which you are setting in the Queue processor context/.