重试过期后如何从JBoss 4.2.2消息队列重新发送消息
有没有办法在JBoss 4.2.2消息队列中重新发送过期消息?问题是它们超出了重试次数,但现在问题已经解决,有没有办法重新发送它们重试过期后如何从JBoss 4.2.2消息队列重新发送消息,jboss,jms,jbossmq,Jboss,Jms,Jbossmq,有没有办法在JBoss 4.2.2消息队列中重新发送过期消息?问题是它们超出了重试次数,但现在问题已经解决,有没有办法重新发送它们 在JBoss3中,它们只是可以移动的文本文件。既然它存储在数据库中,您如何才能做到这一点呢。它是一个用于浏览JMS队列和主题的开源工具。它可以重播最后出现在代理的不可传递队列上的消息。这就是我最后要做的: Hashtable t = new Hashtable(); t.put(Context.PROVIDER_URL, "localhost:109
在JBoss3中,它们只是可以移动的文本文件。既然它存储在数据库中,您如何才能做到这一点呢。它是一个用于浏览JMS队列和主题的开源工具。它可以重播最后出现在代理的不可传递队列上的消息。这就是我最后要做的:
Hashtable t = new Hashtable();
t.put(Context.PROVIDER_URL, "localhost:1099");
t.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
Context ctx = new InitialContext(t);
Queue q = (Queue) ctx.lookup("/queue/DLQ");
//----------------------------
ConnectionFactory cf = (ConnectionFactory) ctx.lookup("/ConnectionFactory");
Connection connection = cf.createConnection();
Session session = connection.createSession(true, 0);
//---------------------------------
MessageConsumer consumer = session.createConsumer(q);
connection.start();
SpyObjectMessage m;
Queue originialDestination = null;
//There can only be one in my case, but really you have to look it up every time.
MessageProducer producer = null;
while ((m = (SpyObjectMessage) consumer.receive(5000)) != null) {
Object o = m.getObject();
Date messageDate = new Date(m.getJMSTimestamp());
String originalQueue = m.getStringProperty("JBOSS_ORIG_DESTINATION");
if (originialDestination == null) {
originialDestination = (Queue) ctx.lookup("/queue/" +
originalQueue.substring(originalQueue.indexOf('.') + 1));
producer = session.createProducer(originialDestination);
}
producer.send(session.createObjectMessage((Serializable) o));
m.acknowledge();
}
//session.commit(); //Uncomment to make this real.
connection.close();
ctx.close();
注:我在CodeStreet工作 我们的“ReplayService for JMS”产品正是为这个用例而构建的:搜索和检索以前发布的消息(n次传递)——JMS实际上是为1次传递而设计的 使用ReplayService for JMS,您可以配置WebLogic录制来记录发布到主题或队列的所有消息。通过基于Web的GUI,您可以搜索单个消息(通过子字符串、XPath或JMS选择器),然后再次将它们重播到原始JMS目标 有关更多详细信息,请参阅