@ComponentProfile(summary="Listen for HTTP traffic on the specified URI", tag="consumer,http,https", metadata={"jettyQueryString","jettyURI","jettyURL","httpmethod","_interlokMessageConsumedFrom"}, recommended={EmbeddedConnection.class,JettyConnection.class}) public class JettyMessageConsumer extends BasicJettyConsumer
You should configure the AdaptrisMessageConsumerImp.setDestination(com.adaptris.core.ConsumeDestination)
to contain the URI that should trigger
this consumer (e.g. /path/to/my/workflow
). The value from
ConsumeDestination.getFilterExpression()
is used to determine which HTTP methods are appropriate for
this consumer and should be a comma separated list. In the event that the filter expression is empty / null then all HTTP methods
are acceptable ("GET", "POST", "HEAD", "PUT", "DELETE",
"TRACE", "CONNECT", "PATCH"
) and will need to be handled directly by your workflow. OPTIONS
will be automatically.
If you want to preserve the http request headers or parameters simply configure a handler for either or both the headers and parameters.
See the following javadoc for the following configuration items for headers/parameters;
Note that if you intend for this class to be consumer withing a PoolingWorkflow
then you should
consider configuring a JettyPoolingWorkflowInterceptor
as part of that workflow.
In the adapter configuration file this class is aliased as jetty-message-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
BasicJettyConsumer.BasicServlet, BasicJettyConsumer.HttpOperation
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
JettyMessageConsumer() |
Modifier and Type | Method and Description |
---|---|
AdaptrisMessage |
createMessage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Create an AdaptrisMessage from the incoming servlet request and response.
|
HeaderHandler<javax.servlet.http.HttpServletRequest> |
getHeaderHandler() |
ParameterHandler<javax.servlet.http.HttpServletRequest> |
getParameterHandler() |
void |
prepare()
Prepare for initialisation.
|
void |
setHeaderHandler(HeaderHandler<javax.servlet.http.HttpServletRequest> headerHandler) |
void |
setParameterHandler(ParameterHandler<javax.servlet.http.HttpServletRequest> parameterHandler) |
asServletWrapper, close, consumeLocationKey, ensureIsPath, getAdditionalDebug, getSendProcessingInterval, getTimeoutAction, getWarnAfter, init, logHeaders, setAdditionalDebug, setSendProcessingInterval, setTimeoutAction, setWarnAfter, start, stop
changeState, getDestination, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState, setDestination
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isTrackingEndpoint
public AdaptrisMessage createMessage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
BasicJettyConsumer
createMessage
in class BasicJettyConsumer
request
- the HttpServletRequestresponse
- the HttpServletResponsejava.io.IOException
javax.servlet.ServletException
HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public ParameterHandler<javax.servlet.http.HttpServletRequest> getParameterHandler()
public void setParameterHandler(ParameterHandler<javax.servlet.http.HttpServletRequest> parameterHandler)
public HeaderHandler<javax.servlet.http.HttpServletRequest> getHeaderHandler()
public void setHeaderHandler(HeaderHandler<javax.servlet.http.HttpServletRequest> headerHandler)
public void prepare() throws CoreException
ComponentLifecycleExtension
CoreException