0

GlassFishのOpenMQを使用してログに記録したい。コンポーネントがこのキューにメッセージを配置できると考えています。単一のmdbのみがこのキューから消費する場合、キューに入れられた順序ですべてのメッセージを受信できるはずです。これは機能し、メッセージの順序をどのように維持できますか?

参考までに、プレゼンテーションにスライドがあり、 JMSが注文を提供したと私は信じていましたが、明らかに誤解を招く恐れがあります。

スライド8のトランスクリプト:

JMSとは何ですか?•メッセージ指向ミドルウェア用のJavaベースのAPI。•次の概念を使用します(とりわけ)>メッセージの順序が保証されます>メッセージの送信時に信頼性のレベルが決定されます>トランザクション(一緒に送信または生成されるメッセージのグループ化)がサポートされます>メッセージの形式はプロデューサー>2つのスタイルのメッセージ配信(ポイントツーポイントとパブリッシュ/サブスクライブ)を提供します。CopyrightSun Microsystems Inc. AllRightsReserved。[8]

http://www.slideshare.net/alexismp/openmq-aquarium-paris-presentation

以下のこれらの回答は、JMS構造が順序を保証しないことを示しています。しかし、コンテナの同時実行性を使用するシングルトンであるMDBが1つしかない場合は、少なくともエンキュー順序を楽しむことができると思います。

見る:

4

1 に答える 1

1

I wouldn't worry about ensuring order on the Queue itself. Just include a timestamp field in your message payload and sort on that after-the-fact. This only becomes a problem when the extra data is unacceptable under extremely high-traffic conditions, but in those cases, it might make sense to revert to local logging temporarily anyway.

Having the additional field also ensures that if a component loses its connection to the Queue, then messages that were intended for delivery an hour prior still have the correct time and "order" when they do make it to the consuming MDB.

于 2011-08-11T18:13:18.383 に答える