participant = DomainParticipantFactory.TheParticipantFactory.create_participant( 0, DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT, null, StatusKind.STATUS_MASK_NONE); publisher = participant.create_publisher( DomainParticipant.PUBLISHER_QOS_DEFAULT, null, StatusKind.STATUS_MASK_NONE); subscriber = participant.create_subscriber( DomainParticipant.SUBSCRIBER_QOS_DEFAULT, null, StatusKind.STATUS_MASK_NONE); topic = participant.create_topic( "Hello", HelloWorldTypeSupport.get_type_name(), DomainParticipant.TOPIC_QOS_DEFAULT, null, StatusKind.STATUS_MASK_NONE); reader = subscriber.create_datareader( topic, Subscriber.DATAREADER_QOS_DEFAULT, null, StatusKind.STATUS_MASK_NONE); status_condition = reader.get_statuscondition(); status_condition.set_enabled_statuses(StatusKind.DATA_AVAILABLE_STATUS); waitset.attach_condition(status_condition); //Waitset to get active conditions waitset.wait(active_cond, Duration_t.from_millis(0)); //Take called when active condition received HelloSeq _dataSeq = new HelloSeq(); SampleInfoSeq _infoSeq = new SampleInfoSeq(); reader.take( _dataSeq, _infoSeq, ResourceLimitsQosPolicy.LENGTH_UNLIMITED, SampleStateKind.ANY_SAMPLE_STATE, ViewStateKind.ANY_VIEW_STATE, InstanceStateKind.ANY_INSTANCE_STATE); //_dataSeq is never more than 1 in length