RTI DDS Subscriber receives message twice

6 posts / 0 new
Last post
xty250hp's picture
Offline
Last seen: 3 years 11 months ago
Joined: 03/09/2015
Posts: 21
RTI DDS Subscriber receives message twice

Hi guys,

My question is why is my subscriber receving the message twice. I have publisher in one domain as "Local domain" and a client that is subscribing to the local domain and to a broadcast domain where the database is situated. 

Source (local) --> Client (local / broadcast) --> Database (broadcast) -- > Client (broadcast)

The process is as follows : source sends an change message to change topic -> Client subscribes to change topic and at the moment that has received a message it sends it to the ChangeTopic inside the broadcast domain. The database saves the item and then it republishes on a ChangeNotificationTopic inside the broadcast domain to whom is interested in a notification. In this case the client has a listener for change notification and it saves the data inside a local repository.

The publisher publishes one time the new object but the subscriber in the client is receiving the message twice. Further on everything works as expected without duplication of messages.

Any Ideas?

Any help is apriciated.

P.S. I am using built in QOS

 

 

 

 

AttachmentSize
Image icon screenshot_50.png15.32 KB
Image icon screenshot_51.png71.49 KB
Organization:
Gerardo Pardo's picture
Offline
Last seen: 1 week 2 days ago
Joined: 06/02/2010
Posts: 602

Hello,

I do not think DDS would deliver the same sample twice. So my immediate suspicion is that it is being written twice. To verify this you can run rtiddsspy with the  -showSampleIdentity option. This will also show the identity of the sample (source GUID and sequence number) which changes each time you call "write"  if it is the identities are different it indicates someone is calling "write" twice on that DataWriter...

If that does not clear thins up, then I would need to understand your setup better. There were a few things there were not clear to me from reading your posting; see below.
 

How many different processes do you have? Is that 3 (source, client, database)?

How many DDS Domain Participants do you have? Is that 4? One for the source, two inside the client (one for local domain and one for the broadcast) and one in the database?

Also, what is the "Database" process. Is this something you wrote or is it using the RTI Database Integration Service?

Assuming the above tried to draw your setup (see attached) is it correct? If not maybe you can update the drawing to make sure we are talking about the same scenario.

Gerardo

xty250hp's picture
Offline
Last seen: 3 years 11 months ago
Joined: 03/09/2015
Posts: 21

Thank you. This is the right topology I am using. The database is something that we have implemented as an abstract layer. After rechecking everything I have found that the samples have diffrent sample identifier.

xty250hp's picture
Offline
Last seen: 3 years 11 months ago
Joined: 03/09/2015
Posts: 21

Hi again.,

The problem persists and I don't seem to wrap my head around it,

I have prepeared a a small proof of concept based on what I am implementing at the moment which could be downloaded from the following link http://1drv.ms/1HKRhJ3 . If anyone can give me a few pointers would be grately apreciated.

DDS is sending old messages along side new messages. With time the amount increases.

Thank You

Gerardo Pardo's picture
Offline
Last seen: 1 week 2 days ago
Joined: 06/02/2010
Posts: 602

Hello,

Are you still struggling with this issue?

The fact that the samples have different identifiers indicate that you are calling the write operation on the DataWriter multiple times. Otherwise DDS would not produce new sequence numbers, etc. There may be some feedback loop where your application is reacting to the reception of an event/DDS message on a topic and write another Topic as a reaction, which chains back (perhaps via other intermediate topics) to producing the first Topic, which again triggers another publication in a self-reinforcing loop.

However this kind of source-code/application troubleshooting is beyond what we are resourced to do in the forums.  Are you under support? If so the best way to proceed would be to submit a support case on the support portal https://support.rti.com  so the support team can take a detailed use at your code and try to identify the issue. If the ammount of old messages increases in time it would further support the presence of this "feedback loop" as each old message essentially cycles for ever and each new message adds another cycle to the mix.

Perhaps if you instrumented your code to echo some message each time you wrote a message (called write on the DDS DataWriter). You could observer this effect and then somehow debug what is causing it.

I was able to download the example and for reference I attached it here removing the objects and libs so that it fits in the 2MB file side. However analyzing appication code and trying to reproduce this type of situation goes beyond the resources we have available for the community forum. Does your company have a support contract with RTI? If so the best approach wouldbe to submit a case to http://support.rti.com as our support team has more resources to help with these types of problems. You do not need to copy the problem there. You can just refer to the forum post and they can take if from there.

Regards,

Gerardo

File Attachments: 
Juanjo Martin's picture
Offline
Last seen: 2 years 4 months ago
Joined: 07/23/2012
Posts: 48

Hi Christian,

I have been able to run your application and receive data samples with a rtiddsspy application. I verified that the samples are just written once using your example.

What I would do if I were you is to run Wireshark in the subscribing application that receives samples twice. This way you can quickly verify which is the source of the data. If you need help interpreting the Wireshark capture, I will be glad to help you.

If you are not a Wireshark user, feel free to upload your capture here in this forum thread or send it directly to me if it contains private data (juanjo@rti.com). If this is the case, I will need all the information you have to identify the applications (IPs, Participant Names if you set them...).

Thanks,
Juanjo Martin

Member of the RTI Support Team