[JBoss Messaging] - JMS Queue/Topic Issue (JBoss SOA 4.3 - JBoss AS 4.2.2)
by J H
J H [http://community.jboss.org/people/jbossuseruseruser] created the discussion
"JMS Queue/Topic Issue (JBoss SOA 4.3 - JBoss AS 4.2.2)"
To view the discussion, visit: http://community.jboss.org/message/549085#549085
--------------------------------------------------------------
I have tried this with both a Queue and Topic. Within the destinations-service.xml file, I have configured a new Queue or Topic, simply by copying and pasting the example one and changing the name (testTopic > newTopic). I have a class that sends simple text messages to the topic and then another class that receieves them. The receiving class is used within a very simple GUI to get the message and display it in a text area. This all works 'fine'.
The problem is after a certain amount of time (there is no regularity in the time this happens...) messages stop being received. Whilst using a topic I have seen the subscription in the JMX-Console and noticed that it is no longer there when messages are not being received. I have tried leaving sessions open - I've tried closing them and then making a new subscription every time - but no matter what I try it never seems to 'stay alive'. I then turned to Queues, thinking that the same problem couldn't possibly apply, but I was wrong, my GUI client stops receiving messages after an arbitrary amount of time. So my question is: Does JBoss have configuration settings for a subscription? Or something along those lines. Or is it something that I am doing wrong:
destinations-service.xml
<mbean code="org.jboss.jms.server.destination.TopicService"
name="jboss.messaging.destination:service=Topic,name=newTopic"
xmbean-dd="xmdesc/Topic-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
<attribute name="SecurityConfig">
<security>
<role name="guest" read="true" write="true"/>
<role name="publisher" read="true" write="true" create="true"/>
</security>
</attribute>
</mbean>
TopicReceiver.java:
private static final String JBOSS_TOPIC_NAME = "topic/newTopic";
private static final String JBOSS_JNDI_CONNECTION_FACTORY = "ConnectionFactory";
private static final String JBOSS_JNDI_PACKAGE = "org.jboss.naming:org.jnp.interfaces";
private static final String JBOSS_JNDI_DRIVER = "org.jnp.interfaces.NamingContextFactory";
private static final String JBOSS_URL = "jnp://localhost:1099";
//The topic to which we will be publishing messages
private Topic testTopic;
//The factory that will build us JMS connections
private TopicConnectionFactory topicFactory;
//The connection to the JMS server
private TopicConnection connection;
//The subscriber object
private TopicSubscriber subscriber;
//The session for receiving
private TopicSession subscribeSession;
private String messageText = "";
/**
* Calls the incomingMessage() method on instantiation
* to get the message from the subscribed Topic.
*/
public TopicReceiver() {
this.setup();
}
/**
* Gets the message that has been stored from the subscribed
* topic.
* @return The newest incoming message.
*/
public String getMessage(){
return messageText;
}
/**
* Sets up the connection to JBoss and the Subscriber, who will
* listen for incoming messages.
*/
public void setup(){
Properties prop = new Properties();
prop.put("java.naming.factory.initial",JBOSS_JNDI_DRIVER);
prop.put("java.naming.provider.url",JBOSS_URL);
prop.put("java.naming.factory.url.pkgs",JBOSS_JNDI_PACKAGE);
InitialContext context;
try {
context = new InitialContext(prop);
//Lookup the JMS connection factory and topic
topicFactory = (TopicConnectionFactory)context.lookup(JBOSS_JNDI_CONNECTION_FACTORY);
connection = topicFactory.createTopicConnection();
testTopic = (Topic)context.lookup(JBOSS_TOPIC_NAME);
subscribeSession = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
subscriber = subscribeSession.createSubscriber(testTopic);
connection.start();
} catch (NamingException e) {
e.printStackTrace();
} catch (JMSException jms){
jms.printStackTrace();
}
}
/**
* Provides a user friendly view of the message - as a String.
* @return The Message contained within the JMS Message object.
*/
public String receiveMessage(){
String msg = "";
try {
Message message = subscriber.receive();
msg = ((TextMessage)message).getText();
System.out.println(msg);
//stop();
} catch (JMSException e) {
e.printStackTrace();
}
return msg;
}
public void stop(){
try {
subscribeSession.close();
subscriber.close();
connection.stop();
connection.close();
} catch (JMSException e) {
e.printStackTrace();
}
}
TopicSender.java:
private static final String JBOSS_TOPIC_NAME = "topic/newTopic";
private static final String JBOSS_JNDI_CONNECTION_FACTORY = "ConnectionFactory";
private static final String JBOSS_JNDI_PACKAGE = "org.jboss.naming:org.jnp.interfaces";
private static final String JBOSS_JNDI_DRIVER = "org.jnp.interfaces.NamingContextFactory";
private static final String JBOSS_URL = "jnp://localhost:1099";
//The topic to which we will be publishing messages
private Topic jbossTopic;
//The factory that will build us JMS connections
private TopicConnectionFactory topicFactory;
//The connection to the JMS server
private TopicConnection connection;
//The publisher object
private TopicPublisher publisher;
//The session for sending
private TopicSession publishSession;
/**
* Default Constructor
*/
public TopicSender(){
}
/**
* Prepares the connection to the Topic on the Server.
*/
public void setup(){
try{
Properties prop = new Properties();
prop.put("java.naming.factory.initial",JBOSS_JNDI_DRIVER);
prop.put("java.naming.provider.url",JBOSS_URL);
prop.put("java.naming.factory.url.pkgs",JBOSS_JNDI_PACKAGE);
InitialContext context = new InitialContext(prop);
//Lookup the JMS connection factory and topic
topicFactory = (TopicConnectionFactory)context.lookup(JBOSS_JNDI_CONNECTION_FACTORY);
connection = topicFactory.createTopicConnection();
jbossTopic = (Topic)context.lookup(JBOSS_TOPIC_NAME);
//to send messages we create a session and a publisher
publishSession = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
connection.start();
}
catch(Exception e){
e.printStackTrace();
}
}
/**
* Sends the message passed through the parameter to a topic named
* 'topic/testTopic'
* @param text - The message that is to be published to the topic.
*/
public void sendMessage(String text){
try {
this.setup();
publisher = publishSession.createPublisher(jbossTopic);
TextMessage tm = publishSession.createTextMessage(text);
publisher.publish(tm);
publisher.close();
this.stop();
}
catch (Exception e) {
e.printStackTrace();
}
}
/**
* Closes the connection and resources in use.
*/
public void stop(){
try {
connection.stop();
publishSession.close();
connection.close();
} catch (JMSException e) {
e.printStackTrace();
}
}
Please let me know if you require more information - any feedback is appreciated,
Thanks,
J
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549085#549085]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [jBPM] - Multiple JBPM4_VARIABLE records pointing to same LOB_ and different EXECUTIONID_
by Jorge Ferreira
Jorge Ferreira [http://community.jboss.org/people/imjorge] replied to the discussion
"Multiple JBPM4_VARIABLE records pointing to same LOB_ and different EXECUTIONID_"
To view the discussion, visit: http://community.jboss.org/message/549077#549077
--------------------------------------------------------------
The ONLY types of variables that are stored for any given process:
* org.w3c.dom.Document
* java.util.List<String>
* java.lang.Boolean
* TWO custom classes that implement java.io.Serializable
For setting a variable value we use several API, but all from publicly exposed jBPM interfaces:
* OpenExecution.setVariable(...);
* ActivityExecution.setVariable(...);
* ExecutionService.setVariable(...);
At the moment JBPM4_VARIABLE has several pairs (2) of records that point to the same LOB_.
select lob_
from jbpm4_variable
group by lob_
having count(1) > 1
order by lob_
select v.key_, v.execution_, v.lob_
from jbpm4_variable v
where v.lob_ in (
1970117,
1970123,
1970218,
2260229,
2260232)
order by v.lob_
|| key_ || execution_ || lob_ ||
| lastProcessTaskOutcome | 1940241 | 1970117 |
| executionWarnings | 1970116 | 1970117 |
| xmlObject | 1940241 | 1970123 |
| processIdentifier | 1970116 | 1970123 |
| xmlObject | 1970139 | 1970218 |
| executionErrors | 1970212 | 1970218 |
| executionErrors | 2260197 | 2260229 |
| executionErrors | 2260223 | 2260229 |
| executionWarnings | 2260197 | 2260232 |
| xmlObject | 2260223 | 2260232 |
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549077#549077]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
[jBPM] - How to model this process with jBPM/jPDL
by Younes Yahyaoui
Younes Yahyaoui [http://community.jboss.org/people/ingedeut] created the discussion
"How to model this process with jBPM/jPDL"
To view the discussion, visit: http://community.jboss.org/message/549070#549070
--------------------------------------------------------------
Hi,
i have a problem with modeling the following process. I will explain the process and hope that someone can help me:
there 5 components :
1. *Dataimporter* : which imports the data from an extern provider (GPS points data)
2. *Filter*** : which filters the incoming data
3. *Trajectorizer* : which builds a trajectories from the incoming filtered GPS Data
4. *Matcher* : matches the trajectories with a digital netz (e.g Navteq)
5. *LinkSpeedGenerator* : which calculates the speed on each trajectorie
So The process is as the following:
The Dataimporter imports the data periodically (e.g evry 20 min) form an extern provider as xml file. It parses it, save the data in a database and send the data to Filter. The filter filters the incoming data using some criteria and than send the filtered data to the trajectorizer.
The trajectorizer filters over again the data using other kriteria and build from the data a set of trajectories in a container. *In the meantime it's possible that new data come form the dataimporter* and will be routed throug the filter to Trajceorizer.
The trajectorizer send the completed trajectories (*in the trajectories'container there are always no completed trajectories because new data come periodically form the dataimporter*) to matcher to match them with a digital netzt and to LinkSpeedGenerator to calculate the speed over each trajectorie.
The Matcher send back the matched trajectories to Trajectorizer which add a quality flag to each trajectories and then save them in a databse.
*So the problem is that the process will never be ended because periodically new data comes form the dataimporter which will be processed by trajectorizer (the trajectories' container will never be empty).*
cann someone please help me by the modeling this process or gives me tips or idea? I will apreciate any form of help.
*Info: the 5 components will be modeled and developped as esb services with jbossesb.*
Thank you very much
Younes
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549070#549070]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
[JBoss AOP] - jboss aop in eclipse - can't make it work
by Aram Hovsepyan
Aram Hovsepyan [http://community.jboss.org/people/aramhovsepyan] created the discussion
"jboss aop in eclipse - can't make it work"
To view the discussion, visit: http://community.jboss.org/message/549067#549067
--------------------------------------------------------------
Hi,
I've just started digging into the jboss AOP, however its been 2 days and I just can't make the most trivial helloworld work. The documentation I've found so far did not help. I'd appreciate a lot if someone would tell me what am I doing wrong. The application is exported to .war and placed in the deploy directory.
I've added -Djboss.aop.verbose=true to JAVA_OPTS and it doesn't produce anything.
Here is what i have:
- org.kuleuven.Test.java
- org.kuleuven.TestAspect.java
- WebContent/META-INF/jboss-aop.xml
+ some stuff that's not relevant
the jboss server is version 5.1 and has jboss.aop running.
In Test.java I have:
...
public void testing()
{
//aspect should execute here
System.out.println("testing");
}
...
The TestAspect.java:
public class TestAspect implements Interceptor {
public String getName() {
return "HelloWorldInterceptor";
}
public Object invoke(Invocation inv) throws Throwable {
System.out.println("Aspect interception");
return inv.invokeNext();
}
}
and the jboss-aop.xml:
<?xml version="1.0" encoding="UTF-8"?>
<aop xmlns="urn:jboss:aop-beans:1.0">
<aspect class="org.kuleuven.TestAspect" scope="PER_VM"/>
<bind pointcut="execution(public void org.kuleuven.Test->testing())">
<advice name="test" aspect="org.kuleuven.TestAspect"/>
</bind>
</aop>
thnx a lot
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549067#549067]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [JBoss Tools] - An internal error occurred during: "Building workspace".
by Heri Bender
Heri Bender [http://community.jboss.org/people/hbender] replied to the discussion
"An internal error occurred during: "Building workspace"."
To view the discussion, visit: http://community.jboss.org/message/549064#549064
--------------------------------------------------------------
Hi Denis
I'm working with JBoss DevStudio 3.0.0.v201003100055R-H50-GA which integrates the JBoss Tools. But I'm not quite sure which version of the JBoss Tools is used. I see on the Plugin details pane several versions: 1.1.0, 3.1.0, 2.1.0, but the build string is always "x.x.x.v201003100055R-H50-GA".
I find the IDE very unstable. One example (I could tell about some more if you are interested): Every second start of the IDE a NullPointer happens somewhere in the deeps ofeclipse:
java.lang.NullPointerException
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:267)
at org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl$SynchronizedResourcesEList.dispatchNotification(ProjectResourceSetImpl.java:335)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:300)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
... (many more).
When this happens one cannot work with the IDE anymore because after a couple of clicks another Nullpointer occurs, and so on. One has to restart eclipse.
You spoke of a version 3.1.1. of the JBoss tools. Can I upgrade my DevStudio-Bundle with this newer version? Is there a chance to have a more stable IDE? I'm unsure because there are many other JBoss-Plugins (Struts, Hibernate, etc.) which have different versions but all the same build string. Thanks for advice.
Heri
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549064#549064]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months