Interface ISender

All Superinterfaces:
org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.Aware, IConfigurable, IConfigurationAware, INamedObject, IScopeProvider
All Known Subinterfaces:
IBlockEnabledSender<H>, ICorrelatedSender, ISenderWithParameters
All Known Implementing Classes:
AbstractBlockEnabledSender, AbstractCollectorSender, AbstractHttpSender, AbstractJdbcQuerySender, AbstractJdbcSender, AbstractMailSender, AbstractSender, AbstractSenderWithParameters, AbstractSenderWrapper, CommandSender, DelaySender, DirectQuerySender, EchoSender, FixedQuerySender, FixedResultSender, FrankSender, HttpSender, IbisJavaSender, IbisLocalSender, JavascriptSender, JdbcIteratingPipeBase.MixedQuerySender, JmsSender, JsonXsltSender, LdapSender, LogSender, MailSender, MessageStoreSender, MongoDbSender, MultipartHttpSender, ParallelSenders, ReconnectSenderWrapper, ReloadSender, RestSender, ResultSet2FileSender, SchedulerSender, SenderSeries, SenderWrapper, SendGridSender, SendMessageJob.SendMessageJobSender, ShadowSender, StoredProcedureQuerySender, WebServiceSender, XmlJmsBrowserSender, XmlQuerySender, XmlValidatorSender, XsltSender, ZipWriterSender

Marks an implementation as responsible for sending a message to some destination.
Author:
Gerrit van Brakel
  • Method Details

    • configure

      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.
      Specified by:
      configure in interface IConfigurable
      Throws:
      ConfigurationException
    • start

      void start()
      This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in the sendMessage() method.
    • stop

      void stop()
      Stop/close the sender and deallocate resources.
    • isSynchronous

      default boolean isSynchronous()
      When true, the result of sendMessage is the reply of the request.
    • sendMessage

      @Nonnull SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException
      Send a message to some destination (as configured in the Sender object). This method may only be called after the configure() method is called.

      The following table shows the difference between synchronous and a-synchronous senders:

       synchronousa-synchronous
      isSynchronous() returnstruefalse
      return value of sendMessage() isthe reply-messagethe messageId of the message sent
      the correlationID specified with sendMessage()may be ignoredis sent with the message
      a {link TimeOutException}may be thrown if a timeout occurs waiting for a replyshould 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.

      Throws:
      SenderException
      TimeoutException
    • sendMessageOrThrow

      @Nonnull default Message sendMessageOrThrow(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException
      Throws:
      SenderException
      TimeoutException
    • consumesSessionVariable

      default boolean consumesSessionVariable(String sessionKey)
      returns 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.