This content has been marked as final.
Show 2 replies
-
1. Possible corrections for the JMS Gateway code?
BKBK Sep 8, 2006 3:03 AM (in response to BKBK)My suggested correction for the JMSGateway.java code assumes that the variable gatewayService has already been defined. However, the current code doesn't define it.
Here follows a suggestion that doesn't assume that gatewayService is defined beforehand.
1) Add the following line to the JMSGateway.java code:
import coldfusion.eventgateway.GatewayServices;
2) Modify the code snippet in my original post to
boolean messageSent = (boolean) GatewayServices.getGatewayServices().addEvent(cfMsg);
if (messageSent)
{
log.info("Added message '" + msgID + "' to queue.");
}
3) Added edit:
(a) You may have to add the following lines at the appropriate places:
private String gatewayID; (add it where the other private variables are declared)
this.gatewayID = gatewayID; (add it just under the line super(gatewayID);)
(b) Replace the line CFEvent cfMsg = new CFEvent(getGatewayID()); with
CFEvent cfMsg = new CFEvent(gatewayID);
-
2. Re: Possible corrections for the JMS Gateway code?
BKBK Sep 22, 2006 3:02 AM (in response to BKBK)To correct the problem, comment out the following lines of code...
Perhaps too drastic. It would be more graceful to use try/catch instead, especially as a durable subscriber may have occasion to call setClientID(). Thus, for example, in JMSConsumer.java, do
try {
this.connection.setClientID(this.configuration.getSubscriberName());
}catch (IllegalStateException e) {System.out.println(e);}
Thanks to Sean Corfield for the remark

