JMS provider SOLACE - Input destination of input Event disabled when execute Enging.Rtc.AbortRTC()

JMS provider SOLACE - Input destination of input Event disabled when execute Enging.Rtc.AbortRTC()

book

Article ID: KB0073495

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.x/6.x

Description

The InferenceAgent stops processing messages from a SOLACE input destination after Engine.Rtc.AbortRTC() called in a Rule triggered by a SOLACE message (Event).

Error in log:
"javax.jms.IllegalStateException: Error acknowledging message - illegal state (Attempted an operation on a closed message consumer.)" 


The InferenceAgents calls JMS API "Session.recover()" when Engine.Rtc.AbortRTC() triggered. With SOLACE as the JMS provider JMS this suspends the input destination.
To validate this take a thread dump (jstack <pid>) and verify the status of the thread that handles the JMS operations. The thread status marked as "(sleeping)" – suspended.

e.g. -Threading Model: SharedQueues
"<URL-Inputdestination>-1"  ---
java.lang.Thread.State: TIMED_WAITING (sleeping)

 

Environment

All Operating Systems

Resolution

It is required to un-suspend the input destination with catalog function "Channel.resumeDestination(<destinationURIEvent>)" after Engine.Rtc.AbortRTC() called.
That's specific to SOLACE as JMS provider. Above action not required for EMS or MQ.

Note (all JMS providers):
The failed message delivered and processed again after Engine.Rtc.AbortRTC() triggered. You have to acknowledge the Event before call Engine.Rtc.AbortRTC() to avoid that a corrupted message processed in a loop (for ever). You can route the Event to an error queue instead (catalog function Event.Ext.routeToImmediate()).

Sample RuleFunction:
/**
 * @description:
      Abort RTC, acknowledge and route the Event to an error queue
      Un-suspend input destination (required when JMS provieder: SOLACE)

   @Parameters:
     - Rule/Rulefunction name
     - Input Event
*/

void rulefunction RuleFunctions.rfAbortRTC {
    attribute {
           validity = ACTION;
    }
    scope {
             String p_sFromRF;
             Event ev;
    }
    body {
             String sEvDestination=Event.getDestinationURI(ev);
             System.debugOut("### " + p_sFromRF + " Start abortRTC() for input destination " + sEvDestination);

             Event.Ext.routeToImmediate(ev,"/Channels/chJMS/destError",null);
             Event.acknowledgeEvent(ev);
                                            
             Engine.Rtc.abortRTC();
             Channel.resumeDestination(sEvDestination);
             System.debugOut("### " + p_sFromRF + " End abortRTC() for input destination " + sEvDestination);
    }
}

 

Issue/Introduction

JMS provider SOLACE - Input destination of input Event disabled when execute Enging.Rtc.AbortRTC()