@FrankDocGroup(order=20, name="Senders") public interface ISender extends IConfigurable
ISender
is responsible for sending a message to
some destination.Modifier and Type | Method and Description |
---|---|
void |
close()
Stop/close the sender and deallocate resources.
|
void |
configure()
configure() is called once at startup of the framework in the configure method of the owner of this sender. |
default boolean |
consumesSessionVariable(String sessionKey)
returns
true if the sender or one of its children use the named session variable. |
default boolean |
isSynchronous()
When
true , the result of sendMessage is the reply of the request. |
void |
open()
This method will be called to start the sender.
|
SenderResult |
sendMessage(Message message,
PipeLineSession session)
Send a message to some destination (as configured in the Sender object).
|
default Message |
sendMessageOrThrow(Message message,
PipeLineSession session) |
getName, setName
getApplicationContext, getName
getConfigurationClassLoader
void configure() throws ConfigurationException
configure()
is called once at startup of the framework in the configure method of the owner of this sender.
Purpose of this method is to check whether the static configuration of the sender is correct.
As much as possible class-instantiating should take place in the configure()
or open()
method, to improve performance.configure
in interface IConfigurable
ConfigurationException
void open() throws SenderException
sendMessage()
method.SenderException
void close() throws SenderException
SenderException
default boolean isSynchronous()
true
, the result of sendMessage is the reply of the request.SenderResult sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException
configure()
method is called.
The following table shows the difference between synchronous and a-synchronous senders:
synchronous | a-synchronous | |
---|---|---|
isSynchronous() returns | true | false |
return value of sendMessage() is | the reply-message | the messageId of the message sent |
the correlationID specified with sendMessage() | may be ignored | is sent with the message |
a {link TimeOutException} | may be thrown if a timeout occurs waiting for a reply | should not be expected |
Multiple objects may try to call this method at the same time, from different threads.
Implementations of this method should therefore be thread-safe, or synchronized
.
SenderException
TimeoutException
default Message sendMessageOrThrow(Message message, PipeLineSession session) throws SenderException, TimeoutException
SenderException
TimeoutException
default boolean consumesSessionVariable(String sessionKey)
true
if the sender or one of its children use the named session variable.
Callers can use this to determine if a message needs to be preserved.Copyright © 2023 Frank!Framework. All rights reserved.