Class WebhookImmediateRetryOutboundServiceFacade

java.lang.Object
de.hybris.platform.webhookservices.service.impl.WebhookImmediateRetryOutboundServiceFacade
All Implemented Interfaces:
OutboundServiceFacade

public class WebhookImmediateRetryOutboundServiceFacade extends Object implements OutboundServiceFacade
Implements the OutboundServiceFacade interface with the SimpleRetryPolicy to enable resending in case of server error failures. The actual sending is delegated to the default implementation DefaultOutboundServiceFacade.
  • Constructor Details

    • WebhookImmediateRetryOutboundServiceFacade

      public WebhookImmediateRetryOutboundServiceFacade(@NotNull @NotNull OutboundServiceFacade outboundServiceFacade, @NotNull @NotNull org.springframework.retry.support.RetryTemplate retryTemplate)
      Constructs a new WebhookOutboundServiceFacade.
      Parameters:
      outboundServiceFacade - OutboundServiceFacade used to send the event out to the destination
      retryTemplate - RetryTemplate to enable resending in case of getting server errors
  • Method Details

    • send

      public rx.Observable<org.springframework.http.ResponseEntity<Map>> send(ItemModel itemModel, String integrationObjectCode, String destination)
      Description copied from interface: OutboundServiceFacade
      Method orchestrates the services to build the payload and to integrate with restful endpoint.
      Specified by:
      send in interface OutboundServiceFacade
      Parameters:
      itemModel - the model to be converted
      integrationObjectCode - the name of the integration object to convert this model as payload
      destination - endpoint destination information
      Returns:
      rx.Observable which allows the caller to subscribe the callback method
    • send

      public rx.Observable<org.springframework.http.ResponseEntity<Map>> send(SyncParameters params)
      Method orchestrates the services to build the payload and to integrate with restful endpoint. The webhook retry template delegates the sending to the default implementation DefaultOutboundServiceFacade. The send action will be attempted twice in case of server error failure, that throws WebhookRetryableException to trigger the retry mechanism.
      Specified by:
      send in interface OutboundServiceFacade
      Parameters:
      params - SyncParameters object which contains the information relevant to perform an outbound request action, containing the item, integration object and destination
      Returns:
      Observable<ResponseEntity < Map>> with the response from the outbound request