-
1. Re: how do I get a DLQ message ?
h.wolffenbuttel Jun 27, 2011 3:14 AM (in response to everjava)hi Everson,
Take a look at thread http://community.jboss.org/thread/167952 , it answers your second question.
Regards,
Hans
-
2. Re: how do I get a DLQ message ?
scottdawson Jun 28, 2011 9:22 AM (in response to everjava)Everson,
Regarding your first question, see this forum thread: http://community.jboss.org/message/517185#517185
John Pount attached a JSP that can retrieve DLQ messages (or other message types) from the message store.
Regards,
Scott
-
3. Re: how do I get a DLQ message ?
everjava Jun 28, 2011 2:52 PM (in response to scottdawson)Hi hans and scott, your answers helped me .. thanks
about my second question I saw the thread, but I didn't try yet...
about my first one, it works. But I get some doubt about
1-dlq message stored on database
2-dlq message stored on jboss queue
I would like to access the messages stored on queue/DQL, to try redelivery case necessary
and for auditing(in this case transform the message to an object again. In my message I have an
object like Person)
Since I'm using jms-jca-provider every error in my action pipeline the message
is sent to queue/DLQ on jboss to store a lost message
My first steps to do that were:
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");
connection = queueConnectionFactory.createQueueConnection();
queue = (Queue) iniCtx.lookup("/queue/DLQ");
...
MessageConsumer consumer = session.createConsumer(queue);
ObjectMessageProxy omp = (ObjectMessageProxy) consumer.receive(2000);
System.out.println( omp.getMessage());
But the console show me: JBossMessage[21442936538595343]:PERSISTENT
How can I convert it ?
I didn't understand very well where I can use dlq message store on database, like:
<action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister">
<property name="classification" value="DLQ"/>
<property name="message-store-class"
value="org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl"/>
</action>
If I have code like below, the PersistAction always is stored. How can I use PersistAction just when error happen ?
<action name="a1" class="Action1"">
<action name="a2" class="Action2">
<action name="a3" class="Action3">
<action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister">
With DLQ message stored on database, I can convert the message to my object:
DBMessageStoreImpl storeImpl = new DBMessageStoreImpl();
Map<URI, Message> map = storeImpl.getAllMessages("DLQ");
Person person = null;
for (org.jboss.soa.esb.message.Message msg : map.values()) {
if (msg.getBody().get() != null){
person = new Person();
person = (Person) msg.getBody().get();// it works
}
I think is more easily do what I want by dlq message stored on database
-
4. Re: how do I get a DLQ message ?
everjava Jul 1, 2011 2:13 PM (in response to everjava)Well, can forget the message above ....
I'm using the approach below to save a message using DBMessageStoreImpl,
when I get err save the message as DLQ classification and ok as STORE.
But I saved as RDLVR, and after couple minutes the classification was change to DLQ.
Why did it happen ?
<action name="notify" class="org.jboss.soa.esb.actions.Notifier">
<property name="destinations">
<NotificationList type="err">
<target class="package.MyNotifyClass" ...
<NotificationList type="ok">
<target class="package.MyNotifyClass" ...