@MetricsReporter public abstract class EgressConnectorElement<S extends SenderConfig,C extends EgressContext> extends AbstractProcessingElement implements XEgressConnectorElement<S,C>, MetricsReportable
EgressConnector
. All egress connectors
must inherit this classModifier and Type | Field and Description |
---|---|
protected org.adroitlogic.x.logging.Logger |
logger |
Constructor and Description |
---|
EgressConnectorElement() |
Modifier and Type | Method and Description |
---|---|
protected ExecutionResult |
continueFlow(ExecutionResult sendingStatus,
XMessageContext messageContext)
The implementation of this method is responsible for continuing the execution of the message flow after
the message has been sent out to an external system which does not return a response.
|
Map<String,String> |
getAdditionalProperties()
Returns a map of additional properties to be set in the metrics records
|
XIntegrationFlow |
getIntegrationFlow() |
protected XConnectorOperationElement |
getOperation() |
protected TransportSender<S,C> |
getSender() |
ExchangePattern |
getSenderExchangePattern() |
protected int |
getSendingFailedStream() |
protected int |
getSendingSuccessStream() |
int |
getWeight() |
protected void |
initEgressConnector(org.springframework.context.ApplicationContext context) |
protected void |
initElement(org.springframework.context.ApplicationContext context) |
protected abstract TransportSender<S,C> |
newSender(org.springframework.context.ApplicationContext context)
Connector implementation should create the sender and return without initialization or starting of the sender
|
ExecutionResult |
process(XMessageContext messageContext) |
ExecutionResult |
receiveResponse(XMessageContext messageContext) |
ExecutionResult |
sendMessage(XMessageContext messageContext) |
protected void |
setEgressFuture(XMessageContext messageContext,
XPlatform platform) |
void |
setIntegrationFlow(XIntegrationFlow integrationFlow) |
void |
setOperation(XConnectorOperationElement operation) |
void |
setWeight(int weight) |
destroy, destroyElement, getBeanName, getEntityId, getErrorHandler, getFlowId, getMetricsEngine, getProject, getProjectId, getProjectVersion, getResource, getServerConfig, getStatus, init, processMessage, setBeanName, setErrorHandler, setFlowId, setProject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEgressContext, getSenderConfig
cast, getBeanName, getFlowId, getProject, getStatus, processMessage, setFlowId, setProject
destroy, init
getEntityId, getFlowId, getMetricsEngine, getProjectId, getProjectVersion
protected final void initElement(org.springframework.context.ApplicationContext context)
initElement
in class AbstractProcessingElement
protected void initEgressConnector(org.springframework.context.ApplicationContext context)
protected abstract TransportSender<S,C> newSender(org.springframework.context.ApplicationContext context)
context
- the application context used for the sender creationpublic final ExecutionResult process(XMessageContext messageContext)
process
in class AbstractProcessingElement
public final ExecutionResult sendMessage(XMessageContext messageContext)
sendMessage
in interface XEgressConnectorElement<S extends SenderConfig,C extends EgressContext>
protected void setEgressFuture(XMessageContext messageContext, XPlatform platform)
protected ExecutionResult continueFlow(ExecutionResult sendingStatus, XMessageContext messageContext)
UniDirectionalResponseEgressConnectorElement
. The default implementation will return the execution
result returned by the TransportSender
.
NOTE: For any EgressConnector which implements this method, it is a MUST for the corresponding
TransportSender
to specify its exchange pattern to be ExchangePattern.OUT_IN
sendingStatus
- The ExecutionResult
result returned by the TransportSender
messageContext
- The XMessageContext
sent to the external systemExecutionResult
from the rest of the flowpublic ExecutionResult receiveResponse(XMessageContext messageContext)
receiveResponse
in interface XEgressConnectorElement<S extends SenderConfig,C extends EgressContext>
public Map<String,String> getAdditionalProperties()
MetricsReportable
getAdditionalProperties
in interface MetricsReportable
getAdditionalProperties
in class AbstractProcessingElement
public void setOperation(XConnectorOperationElement operation)
public int getWeight()
public void setWeight(int weight)
public ExchangePattern getSenderExchangePattern()
protected int getSendingSuccessStream()
protected int getSendingFailedStream()
public XIntegrationFlow getIntegrationFlow()
getIntegrationFlow
in interface XEgressConnectorElement<S extends SenderConfig,C extends EgressContext>
public void setIntegrationFlow(XIntegrationFlow integrationFlow)
setIntegrationFlow
in interface XEgressConnectorElement<S extends SenderConfig,C extends EgressContext>
protected TransportSender<S,C> getSender()
protected XConnectorOperationElement getOperation()
Copyright © 2016–2019 AdroitLogic. All rights reserved.