[JBoss Messaging] - deleting messages rather than blocking if server down for lo
by AdrianWoodhead
I am in the process of evaluating replacing ActiveMQ with JBoss Messaging. Our production systems generate loads of up to around 1 thousand messages a second at peack times.
According to the JBM documentation if the server goes down then the client producer caches outgoing messages until the cache size is reached, after this the calls to send will block. ActiveMQ does something similar and this has led to problems in the past where the server has gone down for an extended period of time and the clients end up with so many blocked threads that they take down the client VM. In this situation we would much rather lose messages and have the clients continue running. Can JBM be configured in such a way that if the server is down that messages are dropped by the client instead of the client threads blocking? (they could be dropped FIFO via some sort of Bounded Queue or based on TTL expiry).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242255#4242255
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242255
17 years
[JBoss jBPM] - jBPM4: Manually created task can't block the execution
by rogerofyan
I have a process definition as shown below:
[img]http://scude.co.cc/pub_img/fork-process.png[/img]
Process definition:
| <process name="EventListener" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start g="100,16,48,48">
| <transition to="wait"/>
| </start>
|
| <state g="84,424,80,52" name="park"/>
| <fork g="100,180,48,48" name="fork1">
| <on event="start">
| <event-listener class="cc.scude.PlaceHomeworkListener"/>
| </on>
| <transition name="to submit" to="task1" g="-59,-21"/>
| <transition to="task2"/>
| </fork>
| <task assignee="stu" g="16,260,92,52" name="task1">
| <transition name="next" to="join1" g="-30,-21"/>
| </task>
| <task assignee="stu" g="140,260,92,52" name="task2">
| <transition to="join1"/>
| </task>
| <join g="100,344,48,48" name="join1">
| <transition to="park"/>
| </join>
| <state g="78,96,92,52" name="wait">
| <transition to="fork1"/>
| </state>
| </process>
|
There are 2 tasks for user 'stu' after the fork node. And I have a EventListener attached to the fork node, which is used to create a task manually.
| public class PlaceHomeworkListener implements EventListener {
| @Override
| public void notify(EventListenerExecution execution) throws Exception {
| Environment env = Environment.getCurrent();
| Context ctx = env.getContext(Context.CONTEXTNAME_PROCESS_ENGINE);
| if (ctx instanceof WireContext) {
| WireContext context = (WireContext) ctx;
| TaskService taskService = context.get(TaskService.class);
|
| Task task = taskService.newTask();
| task.setAssignee("stu");
| task.setName("submit your homework");
| taskService.saveTask(task);
| }
| }
| }
|
The task was created successfully by the listener and it's appeared in stu's personal task list. But it can't block the execution as tasks should be. When I completed the 2 tasks defined in xml, the execution goes to the next state 'park' whether I complete the task created in listener or not. Unit test code looks as below:
| ProcessInstance processInstance = executionService.startProcessInstanceByKey("EventListener");
| String pid = processInstance.getId();
|
| List<Task> tasks = taskService.findPersonalTasks("stu");
| assertEquals(0, tasks.size());
| Execution execution = processInstance.findActiveExecutionIn("wait");
| executionService.signalExecutionById(execution.getId());
|
| tasks = taskService.findPersonalTasks("stu");
| assertEquals(3, tasks.size()); // SUCCESS
|
| //Complete the first two tasks that were defined xml
| for (int i=0;i<2;i++) {
| Task t = tasks.get(i);
| taskService.completeTask(t.getDbid());
| }
| processInstance = executionService.findProcessInstanceById(pid);
|
| assertFalse(processInstance.isActive("park")); //FAILED
|
| tasks = taskService.findPersonalTasks("stu");
| debug("tasks after task completed:"+tasks.size());
| assertEquals(1, tasks.size());
|
If I complete only one task, the last assertFalse line will success. It means that the task defined in xml will stop the execution while the task created in listener not.
How to make the task created in code behaviour the same as that in xml?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242247#4242247
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242247
17 years