[JBoss Messaging] - Distributed queue and several cluster partitions
by Szymon Biliński
Szymon Biliński [http://community.jboss.org/people/ecimon] created the discussion
"Distributed queue and several cluster partitions"
To view the discussion, visit: http://community.jboss.org/message/628525#628525
--------------------------------------------------------------
Hi,
I'm running four JBoss AS 5.1 instances on a single, non-multihomed server (for testing purposes only) and I'm having some difficulties with my JBoss Messaging setup.
My cluster layout is as follows:
|| *Host
* || *Partiton* || Ports
|| *ServerPeerID* ||
| service0 | ServicePartition | ports-default | 1 |
| service1 | ServicePartition | ports-01 | 2 |
| web0 | WebPartition | ports-02 | 3 |
| web1 | WebPartition | ports-03 | 4 |
I'm also using a shared PostgreSQL instance as a persistence provider inside the ServicePartion (no messaging related changes were applied to the WebPartion nodes). I used the attached example (docs/) to create my server/all/deploy/messaging/postgresql-persistence-service.xml on all service nodes. I also applied two minor changes to the PostOffice mbean definition: Clustered and FailoverOnNodeLeave attributes were set to true.
My JMS queue is deployed as a part of the service.ear archive (which goes to service nodes only):
<server>
<mbean code="org.jboss.jms.server.destination.QueueService"
name="jboss.messaging.destination:service=Queue,name=DictionaryTestQueue"
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
<attribute name="Clustered">true</attribute>
</mbean>
</server>
As long as both Web nodes are down everything works fine - I'm able to connect to queue/DictionaryTestQueue with a standalone client (using HA-JNDI) and send a simple text message, which is consequently load balanced across both service nodes.
However, as soon as I launch a Web node, I ocasionally get the following exception (same, standalone client):
Caused by: javax.jms.JMSException: Failed to route Reference[57607127264149508]:RELIABLE to DictionaryTestQueue
at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendMessage(ServerConnectionEndpoint.java:757)
at org.jboss.jms.server.endpoint.ServerSessionEndpoint.send(ServerSessionEndpoint.java:399)
at org.jboss.jms.server.endpoint.advised.SessionAdvised.org$jboss$jms$server$endpoint$advised$SessionAdvised$send$aop(SessionAdvised.java:87)
at org.jboss.jms.server.endpoint.advised.SessionAdvised$send_7280680627620114891.invokeTarget(SessionAdvised$send_7280680627620114891.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.jms.server.container.SecurityAspect.handleSend(SecurityAspect.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.server.endpoint.advised.SessionAdvised.send(SessionAdvised.java)
at org.jboss.jms.wireformat.SessionSendRequest.serverInvoke(SessionSendRequest.java:95)
at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:551)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:211)
at org.jboss.remoting.Client.invoke(Client.java:1724)
at org.jboss.remoting.Client.invoke(Client.java:629)
at org.jboss.remoting.Client.invoke(Client.java:617)
at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)
at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)
at org.jboss.jms.client.delegate.ClientSessionDelegate.org$jboss$jms$client$delegate$ClientSessionDelegate$send$aop(ClientSessionDelegate.java:499)
at org.jboss.jms.client.delegate.ClientSessionDelegate$send_6145266547759487588.invokeTarget(ClientSessionDelegate$send_6145266547759487588.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.jms.client.container.SessionAspect.handleSend(SessionAspect.java:661)
at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleSend_194171714.invoke(SessionAspect_z_handleSend_194171714.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:114)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.client.delegate.ClientSessionDelegate.send(ClientSessionDelegate.java)
at org.jboss.jms.client.container.ProducerAspect.handleSend(ProducerAspect.java:269)
at org.jboss.aop.advice.org.jboss.jms.client.container.ProducerAspect_z_handleSend_194171714.invoke(ProducerAspect_z_handleSend_194171714.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.client.delegate.ClientProducerDelegate.send(ClientProducerDelegate.java)
at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:164)
at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:207)
at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:145)
at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:136)
So it looks to me like a service partiion node is trying to use a web node for queue lookup. Is this the correct behaviour or am I missing something here?
What would be the recommended approach here? Should I define my application queues/setup messaging on all cluster nodes (both partions) or should I keep it separate?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/628525#628525]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[jBPM] - Parallel gateways really parallel?
by Tobias Wittur
Tobias Wittur [http://community.jboss.org/people/tob1as] created the discussion
"Parallel gateways really parallel?"
To view the discussion, visit: http://community.jboss.org/message/628338#628338
--------------------------------------------------------------
Hi,
I was trying to throw and catch a message while also running a count down timer, that terminates the process in case a message is not received within a certain time.
I therefore used a parallel gateway. I ran into some issues and wonder now, are the different branches running in parallel or randomly sequential?
In this process, my service task on the top throws a message, which the intermediate message catch event receives and successfully executes.The service task asks the user per command line, if a message should be thrown.
http://community.jboss.org/servlet/JiveServlet/showImage/2-628338-17049/C... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-628338-170...
I then tried to introduce the timer as a thrid branch. However, the timer is never started. It never "runs into check if message received within time frame".
http://community.jboss.org/servlet/JiveServlet/showImage/2-628338-17050/C... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-628338-170...
I then remodelled the process. Here, suddenly the intermediate catch event is never executed.
http://community.jboss.org/servlet/JiveServlet/showImage/2-628338-17048/C... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-628338-170...
Are those parallel gateways executed sequentially or do they run in separate threads and are executed in parallel?
I know usually I would use an intermediate catch. However, I have to present my process to my boss next week and I have to show, how easily I can introduce change in a modeler to a process and execute it. So subprocesses and event based splits are not an option for this model.
Best regards,
Tobias
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/628338#628338]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[JBoss Web Services] - Jasig CAS with JbossWS
by spyhunter99
spyhunter99 [http://community.jboss.org/people/spyhunter99] created the discussion
"Jasig CAS with JbossWS"
To view the discussion, visit: http://community.jboss.org/message/628436#628436
--------------------------------------------------------------
I have a multilayed application that I need SSO for. Browser > Web App > Web Services. I've managed to get Jasig CAS running on JbossAS 5.0.1 with JbossWS-Native 3.4.0. I can authenticate to the Web App with no problems.
The Web App is some simple JSP pages (packaged as it's own WAR) that calls the Web Services (Packaged in another WAR file). Both WARs are configured as CAS clients and I can hit both of them in the browser (I only have to authenticate once and then I can browse freely between the two deployments)
The next hurtle is calling the web services using a JbossWS client running within a JSP. Ideally, I need the user token to flow from the JSP Web App to the Web Service in a secure and hopefully standardized way. As you can image, it's not working.
So far I've tried taking the Jsessionid and added it to the execution URL of the service, no dice ( the cas module sends a redirect and it doesn't appear that the JbossWS client follows them)
I've also tried a customing SOAP handler that inserts an http header with the jsession info. No dice
I've tried calling GetProxyToken (part of the Jasig framework, however it always returns a null token)
Has anyone gone down this road or a similar before?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/628436#628436]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[jBPM] - Re: Difficulties Invoking Rule Task
by Tihomir Surdilovic
Tihomir Surdilovic [http://community.jboss.org/people/tsurdilovic] created the discussion
"Re: Difficulties Invoking Rule Task"
To view the discussion, visit: http://community.jboss.org/message/628426#628426
--------------------------------------------------------------
Hi Tobias, there is a third options which IMO is some better than the other two which is to attach an AgendaEventListener to your ksession and fire the rules upon an RuleFlowGroupActivatedEvent. Here is an example which is a paste from CommandDelegate.java in the jBPM console:
final org.drools.event.AgendaEventListener agendaEventListener = new org.drools.event.AgendaEventListener() {
public void activationCreated(ActivationCreatedEvent event,
WorkingMemory workingMemory){
}
public void activationCancelled(ActivationCancelledEvent event,
WorkingMemory workingMemory){
}
public void beforeActivationFired(BeforeActivationFiredEvent event,
WorkingMemory workingMemory) {
}
public void afterActivationFired(AfterActivationFiredEvent event,
WorkingMemory workingMemory) {
}
public void agendaGroupPopped(AgendaGroupPoppedEvent event,
WorkingMemory workingMemory) {
}
public void agendaGroupPushed(AgendaGroupPushedEvent event,
WorkingMemory workingMemory) {
}
public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory) {
}
public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory) {
workingMemory.fireAllRules();
}
public void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory) {
}
public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory) {
}
};
((StatefulKnowledgeSessionImpl) ((KnowledgeCommandContext) ((CommandBasedStatefulKnowledgeSession) ksession)
.getCommandService().getContext()).getStatefulKnowledgesession() )
.session.addEventListener(agendaEventListener);
Regarding >> but could the rules engine theoretically be exchanged / how tightly coupled is jBPM with the rules engine? <<
This is where the beauty of custom work items comes in :) You could write your work item to interact with any rule engine or service.
Hope this helps.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/628426#628426]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[jBPM] - Difficulties Invoking Rule Task
by Tobias Wittur
Tobias Wittur [http://community.jboss.org/people/tob1as] created the discussion
"Difficulties Invoking Rule Task"
To view the discussion, visit: http://community.jboss.org/message/627082#627082
--------------------------------------------------------------
Hi,
I was trying to invoke a rule task within my process.
First, I took the example that was part of the unit test examples:
http://community.jboss.org/servlet/JiveServlet/showImage/2-627082-16997/C... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-627082-169...
The execution works fine.
I then added a human task node and a script task:
http://community.jboss.org/servlet/JiveServlet/showImage/2-627082-16998/C... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-627082-169...
Here, the script task prints a hello world, but then the process instance stops at the rule task.
Does anyone know, why it is not running into the rule task? As I estimate, the rule task node has to be active at the time the fireAllRules function is executed ?! But do I have to manually fire that event everytime a rule has to be executed in a process?
The java looks as follows.
> System.out.println("Loading process BPMN2-RuleTask.bpmn2");
> KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
> kbuilder.add(ResourceFactory.newClassPathResource("junit/BPMN2-RuleTask.bpmn2"), ResourceType.BPMN2);
> kbuilder.add(ResourceFactory.newClassPathResource("junit/BPMN2-RuleTask.drl"), ResourceType.DRL);
> KnowledgeBase kbase = kbuilder.newKnowledgeBase();
> StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
>
> ksession.getWorkItemManager().registerWorkItemHandler(
> "Human Task",
> new WSHumanTaskHandler()
> );
>
> List<String> list = new ArrayList<String>();
> ksession.setGlobal("list", list);
> ProcessInstance processInstance = ksession.startProcess("RuleTask");
>
> ksession.fireAllRules();
Best regards,
Tobias
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627082#627082]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month