JBoss Community

JBPM process sends corrupted JMS Messages

created by Fady Magdy in jBPM Development - View the full discussion

Hi,

We are using jboss SOA Platform, we are trying to use a bpmn process to read some data from a database and send a JMS message containing some text to a queue in the ESB, but the ESB randomly fails to  de-sterilize some messages, by debugging we found that some messages arrive at the queue corrupted, this happens only when we publish the workflows at the bpmn server (it works perfectly fine with the process running from in the jboss development studio)

this happens randomly to some messages even if these messages were transmitted correctly before. Any idea what could be the cause of this?

 

This is the code we use to send the messages

 

 

public class SendJMSMessage {

QueueConnection conn;

QueueSession session;

Queue que;

 

 

public void setupConnection() throws JMSException, NamingException

{

Properties properties1 = new Properties();

properties1.put(Context.INITIAL_CONTEXT_FACTORY,

"org.jnp.interfaces.NamingContextFactory");

properties1.put(Context.URL_PKG_PREFIXES,

"org.jboss.naming:org.jnp.interfaces");

properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");

InitialContext iniCtx = new InitialContext(properties1);

 

Object tmp = iniCtx.lookup("ConnectionFactory");

QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;

conn = qcf.createQueueConnection();

  que = (Queue) iniCtx.lookup("queue/ourqueue");

session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

conn.start();

System.out.println("Connection Started");

}

 

public void stop() throws JMSException

{

conn.stop();

session.close();

conn.close();

}

 

public void sendAMessage(String msg) throws JMSException {

 

QueueSender send = session.createSender(que);       

ObjectMessage tm = session.createObjectMessage(msg);

 

send.send(tm);       

send.close();

}

 

 

public void Send(String msg)

{                   

     

       SendJMSMessage sm = new SendJMSMessage();

       sm.setupConnection();   sm.sendAMessage(msg);

       sm.stop();

      

}

}

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community