Stream.of(options.exclusionList()).forEach(real_dests::remove);
Header hdr=opts.hasExclusionList()? new MultiDestinationHeader(Header.REQ, 0, this.corr_id, opts.exclusionList()) : new Header(Header.REQ, 0, this.corr_id);
Stream.of(options.exclusionList()).forEach(real_dests::remove);
@Override public void send(final Buffer data, final boolean synchronous, final long timeout) throws Exception { final RequestOptions options = synchronous ? RequestOptions.SYNC() : RequestOptions.ASYNC(); options.exclusionList( dispatcher.getChannel().getAddress() ); options.setTransientFlags( TransientFlag.DONT_LOOPBACK ); options.setTimeout( timeout ); if ( synchronous ) { try { RspList<Object> rspList = dispatcher.castMessage( null, data, options ); handleResponseProblems( rspList, null ); } catch (Exception e) { throw log.unableToSendWorkViaJGroups( e ); } } else { try { dispatcher.castMessageWithFuture( null, data, options ); } catch (RuntimeException e) { throw log.unableToSendWorkViaJGroups( e ); } } }
Header hdr=opts.hasExclusionList()? new MultiDestinationHeader(Header.REQ, 0, this.corr_id, opts.exclusionList()) : new Header(Header.REQ, 0, this.corr_id);
private void sendMessage(List<LuceneWork> queue) throws Exception { final String indexManagerName = getIndexName(); ServiceManager serviceManager = getExtendedSearchIntegrator().getServiceManager(); //send message to all listeners byte[] data = serviceManager.requestService( LuceneWorkSerializer.class ).toSerializedModel( queue ); data = MessageSerializationHelper.prependString( indexManagerName, data ); final MessageDispatcher dispatcher = new MessageDispatcher( channel ); final RequestOptions options = RequestOptions.SYNC() .exclusionList( channel.address() ) .setTransientFlags( TransientFlag.DONT_LOOPBACK ) .setTimeout( TIMEOUT ); //milliseconds Buffer buffer = new Buffer( data ); dispatcher.castMessage( null, buffer, options ); serviceManager.releaseService( LuceneWorkSerializer.class ); }