publish subscribe - Remove read topic from DDS -


I have a problem subscribing to data (using the Java platform) When a customer subscribes to a topic, Then the data containing that subscription should be removed from the DDS. But in my case whenever I subscribe to the data, the same data is subscribed multiple times. The data has not been removed from DDS. I tried with QoS but I do not know how to use it.

Please suggest how I can remove the data I read from DDS.

This behavior is not due to your QOS settings, but to reach DataReader Is by your method When you retrieve your data, you are probably making some calls in one of the following loopholes in the read () :

  FooReader.read (DataSec, information SEC, 10, ANIISAMAPMEDAAT, value, ANY_VIEW_STATE.value, ANY_INSTANCE_STATE.value);   

reading () The method applied will return all existing samples in your FooReader . After reading () , these samples are still available in FooReader , so the read () method behaves. Think about reading as "Peak". The next time you invite the read () method in this way, you will see all the samples you had seen before, as long as They have a DataWriter .

To solve your problem, you can replace reading () with LE () , like this:

  FooReader.take (DataSec, Information SEC, 10, ANIASAMPLAYAD.AV, ANAI_XIDE_A.A.A.U.E.A.A.A., ANIICIETXT.T.T.AVU);   

LE () method reading () is different from the method in which it reads a destroyer; It not only reads the data but also removes it from the FooReader , in this way, you will not get the same sample twice. In fact, if you resist as read () as opposed to reading () , you will never be able to see a sample twice.

Another way to solve your problem is to stick to reading () , but the requested SAMPLE_STATE to any Adjust NOT_READ from:

  FooReader.read (DataSec, info SEC, 10, NOT_READ_SAMPLE_STATE.value, ANY_VIEW_STATE.value, ANY_INSTANCE_STATE.value );   

In this way, you will only read samples that you have not read before in this case. In this case the difference with LE () is that the data is in your FooReader which can be useful if you want to read it again at the later level (in that case you have to resist the NOT_READ to get the previously read samples < Code> any sample status is to be used).

Comments

Popular posts from this blog

python - Assemble mpeg file unable to play in mediaplayer -

c# - crystal report failed -

mongodb - CakePHP paginator ignoring order, but only for certain values -