[JBoss Messaging] - Re: Configure MDB PoolSize
by Harry P.
Harry P. [http://community.jboss.org/people/harishpandya] created the discussion
"Re: Configure MDB PoolSize"
To view the discussion, visit: http://community.jboss.org/message/625437#625437
--------------------------------------------------------------
Hi jaikiran,
i want to use concurrency using JMS so i used topic implementation of JMS.
My standardjboss.xml is
<proxy-factory-config>
<JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
<ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
<CreateJBossMQDestination>true</CreateJBossMQDestination>
<!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->
<MinimumSize>2</MinimumSize>
<MaximumSize>2</MaximumSize><!--how many parellel need for FPM -->
<KeepAliveMillis>150000</KeepAliveMillis>
<MaxMessages>15</MaxMessages>
<MDBConfig>
<ReconnectIntervalSec>10</ReconnectIntervalSec>
<DLQConfig>
<DestinationQueue>queue/DLQ</DestinationQueue>
<MaxTimesRedelivered>10</MaxTimesRedelivered>
<TimeToLive>0</TimeToLive>
</DLQConfig>
</MDBConfig>
</proxy-factory-config>
Concurrency is achieved. But the problem is that concurrency is applied to a fixed no of messages after that remaining messages are taken sequentially.
Ex.
No. of messages on topic(range) Connecurrency performed for message Sequential
11-15 4 (2 parellel) 7-11
21-24 10(5 parellel) 11-15
25-29 18(9 parellel) 7-11
35-40 34(17 perellel- best perf.) 1-6
do you know why such pattern is followed & can we restrict it.
Thanks in Advance.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/625437#625437]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[jBPM] - Problem persisting tasks
by Asad Rauf
Asad Rauf [http://community.jboss.org/people/imran.h] created the discussion
"Problem persisting tasks"
To view the discussion, visit: http://community.jboss.org/message/625351#625351
--------------------------------------------------------------
I am trying to get persistence setup and I am get the following exception:
java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()
at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:324)
at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:811)
at org.jbpm.task.service.TaskServiceSession.persistInTransaction(TaskServiceSession.java:786)
at org.jbpm.task.service.TaskServiceSession.addUser(TaskServiceSession.java:69)
I saw the a relevant thread on this forum: http://community.jboss.org/thread/162939?start=15&tstart=0 http://community.jboss.org/thread/162939?start=15&tstart=0
According to the advice on this list, I should setup two different persistence units, a separate one for tasks. That works but I end up persisting just the process info and not the task info. This means I am unable to get tasks for a user who logs in at a later time. I am sure this is not expected behavior. My current code is:
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa", HibernateConfig.getPersistenceProps() );
EntityManagerFactory emfTask = Persistence.createEntityManagerFactory( "org.jbpm.myTask", HibernateConfig.getPersistenceProps() );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.TRANSACTION, TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
/* Start Mina server for HT*/
MinaTaskServer server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
thread.start();
TaskServiceSession taskSession = taskService.createSession();
CurrentHibernate.setTaskServiceSession(taskSession);
List<User> users = getSimbaService().getUserService().getAllUsers();
for(User user: users) {
taskSession.addUser(new org.jbpm.task.User(user.getUsername()));
}
//Build Knowlede Base
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("META-INF/PermissionRequest.bpmn"), ResourceType.BPMN2);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler(ksession));
ksession.getWorkItemManager().registerWorkItemHandler("sendPermissionRequest", new PermissionRequestTaskHandler());
Map<String, Object> params = new HashMap<String, Object>();
params.put("description", taskDetails.toString());
params.put("requesterComments", requesterComments);
params.put("approver", toUser);
params.put("permissionRequestItems", taskDetails.toString());
ProcessInstance processInstance = ksession.startProcess("permissionRequest", params);
Thanks for your help.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/625351#625351]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months