公共静态无效sendMessage(DataSource conn,String queueName,String message,String user)抛出SQLException {
try {
QueueConnection QCon = getConnection(conn);
Session session = QCon.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
QCon.start();
Queue queue = ((AQjmsSession) session).getQueue(user, queueName);
MessageProducer producer = session.createProducer(queue);
// msg.setText
Message msg = session.createTextMessage(message);
//set properties to msg since axis2 needs this parameters to find the operation
producer.send(msg);
// TextMessage tMsg = session.createTextMessage(message);
// producer.send(tMsg);
System.out.println("Sent message = " + msg.toString());
session.close();
producer.close();
QCon.close();
} catch (JMSException e) {
e.printStackTrace();
return;
}
}
} 在这里排队消息 or.bindVariables.put(“ DESTINATION”,destination) println(“ queueName ==>” + queueName) println(“或.bindVariables.get(PROVIDER_ABM)” +或.bindVariables.get(“ PROVIDER_ABM”)) println(“ conn” + conn)
AQJMSEnqueue.sendMessage(ds, queueName,or.bindVariables.get("PROVIDER_ABM"), user);
在这里,我试图通过入队在数据库中插入消息。但是在输入数据库后它显示为无效消息。就像即将到来,但必须要来一样,如何在通过oracleenqueue使消息入队之前将xml转换为clob