[JBoss Messaging] - Re: Reliable delivery
by ataylor
The first thing I notice is that you are setting the timetolive on send to 1000ms, this means that most of these messages could expire and never be consumed, set this to 0. However, I think that the reason the throughput is dropping to 0 is because the server has run out of memory, try upping the memory before starting the server or reducing the size of message being sent, say -Xmx512M should do it.
Also you are sending messages as quickly as possible which isn't a true representation of what would happen in a real live deployment. You are basically saturating the server with messages. i.e. if the max size of Q1 is 2000 messages, as soon as the consumer falls this many behind the producer the messages are paged to the database, slowing everything down. Try experimenting with the destination paging parameters(see the users guide) and add a throttle to your sender.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128847#4128847
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128847
18 years, 2 months
[JBoss jBPM] - Re: task-create event
by twiceknightly
Below is a simple unit test. What I am trying to do is set some values in the context on creation of the task in the start state. The event is firing and my action "SetupSuspiciousTransaction" is being run. This action sets variables in the context. Later on I try to retrieve the variables and there values in the method "retrieveVariables". When I step through this method "mappedName" has the right variable name but "value" has null as the value. I was expecting to get back the values I had put in earlier.
| import java.io.InputStream;
| import java.util.Iterator;
| import java.util.List;
|
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.context.def.VariableAccess;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.jbpm.taskmgmt.def.TaskController;
| import org.jbpm.taskmgmt.exe.TaskInstance;
| import junit.framework.TestCase;
|
| public class TaskEventTestCase extends TestCase {
| static JbpmConfiguration jbpmConfiguration = null ;
|
| public TaskEventTestCase(){
| super("TaskEventTestCase") ;
| }
|
| static {
| InputStream is = ClassLoader.getSystemResourceAsStream("default.jbpm.cfg.xml");
| jbpmConfiguration = JbpmConfiguration.parseInputStream(is) ;
| }
|
| public void testSimplePersistence(){
| deployProcessDefinition() ;
| createStartTask() ;
| }
|
| public static void main(String[] args){
| new TaskEventTestCase().testSimplePersistence() ;
| }
|
| public void createStartTask(){
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
| try{
| jbpmContext.setActorId("Fraud Investigator");
| ProcessInstance processInstance = null;
| processInstance = jbpmContext.newProcessInstance("test");
| TaskInstance result = null;
| result = processInstance.getTaskMgmtInstance().createStartTaskInstance();
| jbpmContext.save(processInstance) ;
| retrieveVariables(result) ;
| }
| catch (Exception e){
| throw new RuntimeException(e.getMessage()) ;
| } finally {
| jbpmContext.close() ;
| }
| }
|
| protected void retrieveVariables(TaskInstance ti){
| TaskController taskController = ti.getTask().getTaskController();
| if (taskController!=null) {
| List variableAccesses = taskController.getVariableAccesses();
| Iterator iter = variableAccesses.iterator();
| while (iter.hasNext()) {
| VariableAccess variableAccess = (VariableAccess) iter.next();
| String mappedName = variableAccess.getMappedName();
| String value = (String)ti.getVariable(mappedName);
| }
| }
| }
| public void deployProcessDefinition(){
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
| "<process-definition name='test'>" +
| "<start-state name='state1'>" +
| "<task name='Investigate Transaction' swimlane='Fraud Investigator'>" +
| "<controller>" +
| "<variable name='transaction value' access='read,write,required'></variable>" +
| "<variable name='account number' access='read,write,required'></variable>" +
| "<variable name='transaction status' access='read,write,required'></variable>" +
| "</controller>" +
| "<event type='task-create'>" +
| " <action class='com.nr.tms.workflow.objectservices.actionhandlers.SetupSuspiciousTransaction'/>" +
| "</event>" +
| "</task>" +
| "<transition name='default' to='end1'></transition>" +
| "</start-state>" +
| "<end-state name='end1'></end-state>" +
| "</process-definition>"
| ) ;
|
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
| try{
| jbpmContext.deployProcessDefinition(processDefinition) ;
| } finally {
| jbpmContext.close() ;
| }
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128834#4128834
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128834
18 years, 2 months