Search in sources :

Example 1 with SenderBase

use of nl.nn.adapterframework.senders.SenderBase in project iaf by ibissource.

the class InputOutputSenderWrapperProcessorTest method getSenderWrapper.

public SenderWrapperBase getSenderWrapper() {
    SenderSeries senderSeries = new SenderSeries();
    senderSeries.registerSender(new SenderBase() {

        @Override
        public Message sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException {
            try {
                return new Message("Sender 1: [" + message.asString() + "]");
            } catch (IOException e) {
                throw new SenderException(e);
            }
        }
    });
    senderSeries.registerSender(new SenderBase() {

        @Override
        public Message sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException {
            try {
                secondSenderOutput = "Sender 2: [" + message.asString() + "]";
                return new Message(secondSenderOutput);
            } catch (IOException e) {
                throw new SenderException(e);
            }
        }
    });
    return senderSeries;
}
Also used : Message(nl.nn.adapterframework.stream.Message) SenderBase(nl.nn.adapterframework.senders.SenderBase) PipeLineSession(nl.nn.adapterframework.core.PipeLineSession) IOException(java.io.IOException) SenderException(nl.nn.adapterframework.core.SenderException) SenderSeries(nl.nn.adapterframework.senders.SenderSeries) TimeoutException(nl.nn.adapterframework.core.TimeoutException)

Aggregations

IOException (java.io.IOException)1 PipeLineSession (nl.nn.adapterframework.core.PipeLineSession)1 SenderException (nl.nn.adapterframework.core.SenderException)1 TimeoutException (nl.nn.adapterframework.core.TimeoutException)1 SenderBase (nl.nn.adapterframework.senders.SenderBase)1 SenderSeries (nl.nn.adapterframework.senders.SenderSeries)1 Message (nl.nn.adapterframework.stream.Message)1