Sidebar

How do I use qie.addInboundMessage within an Ack Script to re-process the message?

0 votes
328 views
asked May 3, 2019 by lewis-s-9714 (1,020 points)
I'm waiting for acknowledgement for an HL7 message before processing the message again, so I'm trying to send the message back through the same channel in the Ack Script. I've found qie.addInboundMessage and I'm passing in the string for the HL7 message that was processed once already, but I don't know what is expected in the second parameter "originalFile" when the message did not come from a file at all.

I keep getting errors, particularly "WrappedException: Wrapped java.lang.NullPointerException", whether I put an empty string, a fake path, or a real path with a real message. I'd rather not write or read to a file at all. Excluding the second parameter gives me an error that the function isn't recognized. Is there a function that allows me to re-process the message or send the message to a new channel from the Ack Script?

 

qie.addInboundMessage(source.toString(), 'C:\\Temp\\empty.zxz')

1 Answer

+1 vote
 
Best answer

qie.addInboundMessage is not availabe in an ack script it would appear. I will report that.

However there is a solution:

1. error the message in the ackScript with an error of your choice. I used "resubmitMe"

message.error('resubmitMe');

2. Add a scheduled script to resubmit the error.

var errors = errorManager.searchErrors('error=resubmitMe');
for (var errorId = 0; errorId < errors.size(); errorId++) {
   var messageQueueId = errors.get(errorId);
   var sourceMessage = errorManager.getSource(messageQueueId);
   qie.debug('messageQueueId: ' + messageQueueId);
   errorManager.resolveError(messageQueueId, sourceMessage);
}

answered May 3, 2019 by brandon-w-8204 (33,270 points)
selected May 3, 2019 by lewis-s-9714
...