0

JBoss 4.2.2メッセージキューで期限切れのメッセージを再送する方法はありますか?問題は、再試行回数を超えたことですが、問題は修正されたので、再送信する方法はありますか?

JBoss 3では、それらは移動可能な単なるテキストファイルでした。データベースに保存されたので、どうすればよいでしょうか。

4

3 に答える 3

1

HermesJMSをご覧ください。これは、JMSキューとトピックを参照するためのオープンソースツールです。ブローカーの配信不能キューに到達するメッセージを再生できます。

于 2009-05-20T21:48:23.220 に答える
0

これは私がやったことです:

    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();
于 2009-05-21T17:01:51.920 に答える
0

注:私はCodeStreetで働いています

「ReplayServiceforJMS」製品は、まさにこのユースケース向けに構築されています。以前に公開されたメッセージの検索と取得(n回の配信)-JMSは、実際には1回の配信用に設計されています。

ReplayService for JMSを使用すると、トピックまたはキューに公開されたすべてのメッセージを記録するようにWebLogic記録を構成します。次に、WebベースのGUIを使用して、個々のメッセージを(サブストリング、XPath、またはJMSセレクターで)検索し、元のJMS宛先に再度再生できます。

詳細については、 http://www.codestreet.com/marketdata/jms/jms_details.phpを参照してください。

于 2014-09-05T15:22:15.080 に答える