예제 #1
0
 /// <summary>
 /// Create an [[https://www.rabbitmq.com/tutorials/tutorial-six-java.html RPC style flow]] for processing and communicating
 /// over a rabbitmq message bus. This will create a private queue, and add the reply-to header to messages sent out.
 ///
 /// This stage materializes to a <see cref="Task{String}"/>, which is the name of the private exclusive queue used for RPC communication.
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="repliesPerMessage">The number of responses that should be expected for each message placed on the queue. This
 /// can be overridden per message by including <code>expectedReplies</code> in the the header of the <see cref="OutgoingMessage"/></param>
 /// <returns>TBD</returns>
 public static Flow <ByteString, ByteString, Task <string> > CreateSimple(AmqpSinkSettings settings,
                                                                          int repliesPerMessage = 1)
 {
     return(Flow.Create <ByteString, Task <string> >().Select(bytes => OutgoingMessage.Create(bytes, false, false))
            .Via(Create(settings, 1, repliesPerMessage)).Select(_ => _.Bytes));
 }
예제 #2
0
 /// <summary>
 /// Creates an <see cref="AmqpSink"/> that accepts <see cref="ByteString"/> elements.
 /// </summary>
 /// <param name="settings">the sink settings</param>
 /// <returns>an <see cref="AmqpSink"/> that accepts <see cref="ByteString"/> elements.</returns>
 public static Sink <ByteString, Task> CreateSimple(AmqpSinkSettings settings)
 {
     return(Create(settings).ContraMap <ByteString>(bytes => OutgoingMessage.Create(bytes, false, false)));
 }