@@ -574,22 +574,18 @@ public MessageStatus publish( String channelName, Object message,
574574 * delivery.
575575 * @return a data structure which contains ID of the published message and the status of the publish operation.
576576 */
577- public MessageStatus publish ( String channelName , Object message , PublishOptions publishOptions , DeliveryOptions deliveryOptions )
577+ public MessageStatus publish ( String channelName , Object message , PublishOptions publishOptions ,
578+ DeliveryOptions deliveryOptions )
578579 {
579580 channelName = getCheckedChannelName ( channelName );
580581
581582 if ( message == null )
582583 throw new IllegalArgumentException ( ExceptionMessage .NULL_MESSAGE );
583584
584- if ( deliveryOptions .getSegmentQuery () != null && deliveryOptions .getSegmentQuery ().isEmpty ())
585+ if ( deliveryOptions .getPushBroadcast () == 0 && deliveryOptions .getPushSinglecast ().isEmpty () )
585586 {
586- MessageStatus ms = new MessageStatus ( null , PublishStatusEnum .FAILED );
587- ms .setErrorMessage ( "Empty recipient list for singlecast publishing." );
588- return ms ;
589- }
590-
591- if ( deliveryOptions .getPushBroadcast () == 0 && deliveryOptions .getPushSinglecast () == null )
592587 deliveryOptions .setPushBroadcast ( PushBroadcastMask .ALL );
588+ }
593589
594590 return (MessageStatus ) Invoker .invokeSync ( MESSAGING_MANAGER_SERVER_ALIAS , "publish" , new Object [] { channelName , message , publishOptions , deliveryOptions } );
595591 }
@@ -672,18 +668,6 @@ public void publish( String channelName, Object message, PublishOptions publishO
672668 if ( message == null )
673669 throw new IllegalArgumentException ( ExceptionMessage .NULL_MESSAGE );
674670
675- if ( deliveryOptions .getSegmentQuery () != null && deliveryOptions .getSegmentQuery ().isEmpty () )
676- {
677- MessageStatus ms = new MessageStatus ( null , PublishStatusEnum .FAILED );
678- ms .setErrorMessage ( "Empty recipient list for singlecast publishing." );
679- if ( responder != null )
680- responder .handleResponse ( ms );
681- return ;
682- }
683-
684- if ( deliveryOptions .getPushBroadcast () == 0 && deliveryOptions .getPushSinglecast () == null )
685- deliveryOptions .setPushBroadcast ( PushBroadcastMask .ALL );
686-
687671 Invoker .invokeAsync ( MESSAGING_MANAGER_SERVER_ALIAS , "publish" , new Object [] { channelName , message , publishOptions , deliveryOptions }, responder );
688672 }
689673 catch ( Throwable e )
0 commit comments