Solved

Simple JMS quuestion

Posted on 2002-07-03
8
252 Views
Last Modified: 2010-03-31
Hi all
Can subscriber subscribe messages that published to the Queue befor he asked to subscribe messages? I need to know if it's configurable.
   Thanks  
0
Comment
Question by:dannysh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 2

Expert Comment

by:nir2002
ID: 7129408
Hi,

I don't think I understand what you are trying to ask.
you can "publish" messages to topic/queue and you can become listener to messages destinate to  specfic topic/queue (this is to "subscribe" to this specfic topic/queue).

Note that the subscribe/publish words, there proper use is in context of topic and not of queue.

In general Object can make himself listener (subscribe himself) and subscribe other object before/after he subscribe himself I have alreday done it.

Best regards
Nir
0
 

Author Comment

by:dannysh
ID: 7130146
Hi Nir
What I mean to ask is if subscriber can consume messages that where published to the topic before it connect that topic as subscriber?
 
   Danny
0
 

Author Comment

by:dannysh
ID: 7130149
Is it possible control this via the setTimeToLive() method of topicPublisher class? What happen to a message that have TTL of 60 seconds and after 30 seconds subscriber register himself to that topic? will he get that message even that he register after the message sent to that topic?
   Danny
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:nir2002
ID: 7134683
Hi Danny,

For retrieving all messages (including ones that you were inactive)on topic, you should subscribe as durable subscriber.

Offcourse if a message have expired, you won't get it.

Hope it help.
Nir
0
 

Author Comment

by:dannysh
ID: 7134688
Hi Nir
Do you mean expired after time to live? By default time to live value is set to zero (from documentation) which means unlimited time am I right?
What does durable means? Isn't it only for cases when the server is falling down and then up?
   Danny
0
 
LVL 2

Accepted Solution

by:
nir2002 earned 40 total points
ID: 7134698
Hi Danny,

yes you right the deafult is unlimited time, message never expires (Although I am not certain the value is zero, if you want to set expiration simple use setJMSExpiration(long expiration)).

for the second part no, in API:
"If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired. "

Best regards
Nir


0
 

Author Comment

by:dannysh
ID: 7134701
Thanks a lot Nir.
BTW where are you from?
0
 
LVL 2

Expert Comment

by:nir2002
ID: 7134716
I am glad I could help you :-)
If you want to correspond
nirp_98@yahoo.com
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Convert from a json string array to a Java object 3 65
jsp error 6 47
wild fly 8 startup error 2 43
Tomcat 9 + java 8 error while trying to deploy a war file 2 727
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question