[JBoss Messaging] - Re: Redelivery order
by szhigunov
1) Queue is deployed on the remote server.
2) My consumer is not an MDB. It is a normal JMS consumer deployed as MBean. It gets connection to the queue through JCA adapter.
3) I control the transaction using TransactionManager interface.
4) On RuntimeException, I close all JMS objects (consumer, session, connection) and rollback the transaction.
5) Then if I restart queue on the remote server and start my consumer again - messages are delivered in the correct order (in tests I did).
What happens if you not just restart the queue but restart the JBoss? Not a solution, just for information.
My logic was that restart would clear all buffers and force JBM to reread messages from DB (hopefully in the order they were written in the first place)
I am in a prototype phase, not sure if will try to use it or not.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158369#4158369
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158369
17 years, 10 months
[JBoss jBPM] - Get Task Name in a ActionHandler
by Fornachari
Hi everybody,
I have a simple process. In this process, I have one transition that have an action. This action invokes a Handler. So, I implemented a handler and in this handler I need to know what are the name of the last task.
For example, my process:
START
|
TASK1
| ---------> in this transaction I invoke my handler
END
For the process above, I would like that my handler get the task name. The task name in this case is TASK1.
I tried a lot of things but without success. Some code that I tried are below:
| public void execute(ExecutionContext context) throws Exception
| {
| try
| {
| String taskName = context.getTaskInstance().getName();
| }
|
| catch(Exception e)
| {
| }
| }
|
AND
| public void execute(ExecutionContext context) throws Exception
| {
| try
| {
| TaskInstance taskInstance = context.getTaskInstance();
| String taskName = taskInstance.getName();
| }
|
| catch(Exception e)
| {
| }
| }
|
Just to debug better, inside the catch method, I call a method to write the error in a TXT file. The error that I receive, to both cases above, is: NULL
Anybody know How can I do it?
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158364#4158364
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158364
17 years, 10 months