Class JpaOutboundGateway

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class JpaOutboundGateway extends AbstractReplyProducingMessageHandler
The Jpa Outbound Gateway will allow you to make outbound operations to either:
  • submit (insert, delete) data to a database using JPA
  • retrieve (select) data from a database
Depending on the selected OutboundGatewayType, the outbound gateway will use either the JpaExecutor's poll method or its executeOutboundJpaOperation method.

In order to initialize the adapter, you must provide a JpaExecutor as constructor.

Since:
2.2
Author:
Gunnar Hillert, Amol Nayak, Artem Bilan, Gary Russell
  • Constructor Details

    • JpaOutboundGateway

      public JpaOutboundGateway(JpaExecutor jpaExecutor)
      Constructor taking an JpaExecutor that wraps all JPA Operations.
      Parameters:
      jpaExecutor - Must not be null
  • Method Details

    • getComponentType

      public String getComponentType()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this method to provide component type information.
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class MessageHandlerSupport
    • handleRequestMessage

      protected Object handleRequestMessage(Message<?> requestMessage)
      Description copied from class: AbstractReplyProducingMessageHandler
      Subclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.
      Specified by:
      handleRequestMessage in class AbstractReplyProducingMessageHandler
      Parameters:
      requestMessage - The request message.
      Returns:
      The result of handling the message, or null.
    • setGatewayType

      public void setGatewayType(OutboundGatewayType gatewayType)
      Specify the JpaOutboundGateway mode.
      Parameters:
      gatewayType - The gateway type.
    • setProducesReply

      public void setProducesReply(boolean producesReply)
      If set to 'false', this component will act as an Outbound Channel Adapter. If not explicitly set this property will default to 'true'.
      Parameters:
      producesReply - Defaults to 'true'.