Why this dynamically created subscriber can not receive messages?

11 posts / 0 new
Last post
Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7
Why this dynamically created subscriber can not receive messages?

I am writing a public transport system using RTI DDS, but I met a strange problem:

 

This situation works well:

1. start a passenger subscriber with content filtered topic
2. start publishers
3. the passenger subsriber gets the messages well
4. start a second passenger subscriber with a different content filtered topic
5. the second passenger subscriber gets the messages well


This situation has problem:

1. start a operator subscriber
2. start a passenger subscriber with content filtered topic
3. start publishers
4. the operator subscriber gets the messages well
5. the passenger subscriber can get the expected message
6. start a second passenger subsciber with a different content filtered topic
7. the second passenger subscriber can not receive any message

 

This situation also works fine:


1. start a passenger subscriber with content filtered topic

2. start a second passenger subscriber with content filtered topic
3. start publishers
4. both passenger subscribers can get the expected message
5. start two new passenger subscibers with different content filtered topic
6. both of new passenger subscribers receive message well

 

Please note that the new passenger subscribers with different content filtered topic were started by the program, not by me through command line. And they still can not receive any messages even I removed the content filter. Seems that this problem was caused by that operator subscriber. I am really confused... Can anyone help me? Thank you!

Organization:
gianpiero's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 06/02/2010
Posts: 177

Can you please post the code.. and some instruction on how to build..

 

Thanks, 

  gp

Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7

Sorry I can not post the code now...it's a project for a class, due next month.

gianpiero's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 06/02/2010
Posts: 177

 

Ok, can you try to set Durability to TRANSIENT_LOCAL and be sure that RELIABILITY is also set. 

 

gp

Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7

Why? I do not want the datareader to get the messages published before it is created...

Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7

To gp: your answer really works! Actually before I set the QoS mentioned in your answer, the new subscribers can receive the messages, but for some cases, some messages will be lost. I asked the question, becasue I happened to try for these cases, and I did not wait for enough time, so I thought the new subscribers can not receive messages. After I tried your suggestion, the messages will not be lost, however, there is some delay now... Thank you very much!

Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7

I just found that the reason the new subscriber can not get any messages is not because of QoS, it's because of the way the subscriber is started. After I changed the way starting the new subscriber:

    a) If I do not set the QoS, some messages will be lost for some cases

    b) If I set the QoS, messages will not be lost for these cases, but there is delay

gianpiero's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 06/02/2010
Posts: 177

How were you starting the subscriber? And how are you starting it now?

Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7

Previously I started new subscriber from inside old subscriber, now I start it from outside the old subscriber...

gianpiero's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 06/02/2010
Posts: 177

With starting it from inside an old subscriber, do you mean in a call back? If yes, please have a look to chapter 17 of RTI_DDS_UserManual.pdf

Offline
Last seen: 13 years 8 months ago
Joined: 11/03/2010
Posts: 7

Yes. Did you mean I should set use_shared_exclusive_area to true? But this will reduce the concurrency, right? So starting from outside is still better?