Amir Pourteymour

Ranch Hand
+ Follow
since Mar 06, 2008
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Amir Pourteymour

Did you actually create the destinations and connection factories you are trying to use?
Sorry to get back to you late, but anyway,

Well, there are couple of them by default in any application server. for example you can find destinations such as queues A, B, C, etc. and the same with topics. However, for your own configured destination, you can create new ones, so others using your provider do not change anything in your configuration.

In order to do so, you have to startup the application server (e.g., Jboss), and load the administration UI through their default IP address that they give on their website. Then you should go and create your own destination. Some of these application servers such as Jboss provides you a feature of adding, modifying, or deleting any JMS destination manually in their xml configuration files.
One to One such as any interaction between two modules or applications. You can connect your internal application with the one that has been developed outside your company as a 3rd-party application.

One to Many can be any notification or messaging system that you want to notify certain consumers or applications. For example it can be stock market, weather channel, event handler, message router, or anything like that.

Nowadays there are many projects in both academia and the industry. Just search in google and you can find plenty of them using JMS in their architecture. Another way to find real-life projects is to visit the website of famous application servers and you can see their customers.

Hope it was helpful,

You should check first your classpath settings to see if you have included all necessary libraries and files. In addition to that check if you have created those objects in the Application servers (e.g. ConnectionFactory, Queues, or Topics).

Originally posted by kavitha vasu:
Do i need any Application server?

Yes You need an application server in order to use your JMS destinations (e.g. Queue or Topic). After you setup your ConnectionFactory and destinations, you can simply start using it in your application.

For Application servers you have access to different commercial and open-source AS such as Jboss Application Server, GlassFish, ActiveMQ, and etc.

Is there any way to measure the size of each JMS object message in application servers such as Jboss?


I am using my Jboss Application Serer (Version: 4.2.2.GA) to run my JMS application. As long as I am using "jnp://localhost:1099", it works, but when I change localhost to the IP address ("jnp://") of the same machine, it gives me the following error. I also changed the like this:


Error :
javax.naming.CommunicationException: Could not obtain connection to any of these urls: and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is Receive timedout] [Root exception is javax.naming.CommunicationException: Failed to connect to server [Root exception is javax.naming.ServiceUnavailableEx
ception: Failed to connect to server [Root exception is Connection refused: connect]]]
I don't think that's related to the fact that your message is persistent or not. Java Heap size error raises usually when you're injecting too many messages more than capacity of your heap sizes. Temporary you can increase the heap size, but I guess it's rather the problem of the internal data storage that JBoss uses. It's more a development product rather than a product DB. You should use more persistent DB instead.

Well, you check this in your code level not in Jboss. In your code, you set these, and your delivery mode would be persisten.

Maybe you mean Physical queue, so in that case by adding these lines

in nameOfYourService\deploy\jboss-messaging.sar

Hope I could answer your question.
I think if you are new to this, "Head first EJB" helps you through with its own way of visual layout. Highly recommended.
The JDK version that you used to code and the one you're using to run are different. That's why you should use the same version or use this command while compiling.

javac -source version -target version
16 years ago
You can also try Head First Java.
16 years ago
Can you clarify this more?

Do you mean if receiver 1 picks up the message, but takes more than enough to process due to any failure or computation freeze on his side. Receivers 2 comes and pick up the message to process?

What about using a demand store in your application server side, where you store the status of every single message to the point they're computed 100%, and remove the status afterward. Then, you can have the option to inquiry anything over there. Any pending message, which is not processed yet.

(+) Simple to implement, very handy in different situations, easy to learn about any failure in your system and route to another receiver.

(-) If you have cluster of application server, you need to have either distributed instances of your demand store. This makes the tracking very complicated.
If you create a persistent queue, it does not disappear from your system until you remove them from your JNDI lists manually. This is the story with the persistent queue, but with temporary you're right. So, if you create and deploy persistent destinations at runtime, you won't have such a problem.

Yes Of course, I would like to know more about your project, and I will send you a private message for my contact information.

It means that you should have an application server somewhere in your network where you create your JNDI objects. You are actually looking up the IP address of that host.