Mixing dynamic and non-dynamic registrations for a single type on a participant

6 posts / 0 new
Last post
Offline
Last seen: 6 months 1 week ago
Joined: 02/20/2014
Posts: 9
Mixing dynamic and non-dynamic registrations for a single type on a participant

Hello, I'm running a fairly complicated application entirely within a single DDS participant.  In this, the bulk of the threads going are creating normal DDS subs/pubs, but I'm trying to have one thread create dynamic data subscribers for the data published by the other threads.

I'm running into some roadblocks, notably that register_type() seems to be conflicting because of the differences in the type plugins used for the registration using the autogenerated type's TypeSupport class and the type plugin used for dynamic data.  I'd hoped that in this case of mixing autogenerated and dynamic registrations I could just leave the autogenerated type's registration, but doing that I just start getting errors calling the dynamic data's narrow call.

Am I correct in saying that this is impossible in 5.2.3 and that if I really want to do this I'll have to register a new participant for just the dynamic data subscribers?

Offline
Last seen: 2 years 4 months ago
Joined: 11/28/2016
Posts: 7

Hi,

Could you clarify me if you are registering the DynamicData type and multiple types in the same participant when you have the error?  Or you are just trying to register a DynamicData type? If it is the second option, you should be able to register the DynamicData type with the following functions:

  • C: DDS_DynamicDataTypeSupport_register_type
  • Traditional C++: type_support->register_type
  • Modern C++: The type is registered when the Topic is created
  • C#: type_support.register_type
  • Java: type_support.register_type
Best,
     David
Offline
Last seen: 6 months 1 week ago
Joined: 02/20/2014
Posts: 9

Hi David, I'm trying to register both the DynamicData version of the type and the autogenerated version of the same type on the same participant.  Since I guess internally the type is registered by name and only one plugin can be associated with the registration, it ends up conflicting even though the typecodes are identical.

So for type Foo I'm trying to call both DDS_DynamicDataTypeSupport_register_type, and also FooTypeSupport_register_type.  This would allow me to have one thread that can use DDS normally, while another thread can access it with dynamic data which gives access to the underlying CDRStream.

Offline
Last seen: 2 years 4 months ago
Joined: 11/28/2016
Posts: 7

Hi,

      You should not have any issue when you register both types. The only problem you may have is in the name, but this is solved changing the name of one of them (you cannot have two different types with the same name). Next week, I'll upload to the community one example with an application using both types, autogenerated and DynamicData.

Best regards,
David
Offline
Last seen: 5 months 3 weeks ago
Joined: 10/01/2015
Posts: 17

I have a similar issue with my application. 

Registering types with different names works, but then you run into creating topics with different types.  I can't use different naems for the topics, because the name must match the publication.

I want to listen to a single topic, with 2 readers, one staticly typed, and one dynamicly typed. 

I'm currently using 2 participants as a workaround.

Offline
Last seen: 2 years 4 months ago
Joined: 11/28/2016
Posts: 7

Hi,

Sorry for taking so long. I attached an example with a solution to use at the same time DynamicData and non DynamicData. Note that, as seymour33 noted, you must create different topics with different types.