java - Spring Integration : int-http:inbound-gateway with url Path Variables -


I'm trying to test the inbound http gateway using Spring Integration int-http: inbound-gateway:

  & lt; int-http: inbound-gateway id = "correlateOutgoingMessage" aided method = "post" request-channel = "ToOutCorrelator" North-channel = "must apply Korerletr" view-name = "/ correlate Autgrejing" path = "/ CorrelateOut / { Origin} / {msgtype} / {preference} "reply-timeout =" 50000 "& gt; & Lt; Int-http: header name = "orig" expression = "# pathVariables.origin" /> & Lt; Int-http: header name = "msgtype" expression = "# path variables. MMSI type" / & gt; & Lt; Int-http: header name = "priority" expression = "#password priority" /> & Lt; / Integer - http: inner gateway & gt;   

My Web.xml:

  & lt; Servlet & gt; & Lt; Servlet-name & gt; CorrelateOut & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Org.springframework.web.servlet.DispatcherServlet & lt; / Servlet category & gt; & Lt; Init-param & gt; & Lt; Ultimate Name & gt; ContextConfigLocation & lt; / Lastname & gt; & Lt; Ultimate Price & gt; Web-INF / intg-Schema.xml & lt; / Super-valued & gt; & Lt; / Init-param & gt; & Lt; Load-On-Startup & gt; 1 & lt; / Load-on-startup & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; CorrelateOut & lt; / Servlet-name & gt; & Lt ;! - Controller / * - & gt; & Lt; URL pattern & gt; / CorrelateOut / * & lt; / URL pattern & gt; & Lt; / Servlet-mapping & gt;   

Using RestTemplate I'm trying to request a post on Gateway:

  Yuri = "http: / / Localhost: 8080 / test / correlated outfit message / {original} / {msgtype} / {preference} "string origin =" xxxx "; Integer message = 2333; Integer priority = 2; HTTP header header = new HTTP header (); Headers.setContentType (MediaType.TEXT_PLAIN); HttpEntity & LT ;? & Gt; Request = zero; ResponseEntity & LT; String & gt; HttpResponse = null; Request = new HttpEntity & lt; Object & gt; (MessageContent); HttpResponse = template.exchange (uri, HttpMethod.POST, Requests, String.class, getUrlParams (original, msgtype, priority));   

I'm still not getting 404, would you please give me some hints?

Thanks a lot!

Firstly you should show Yuri that you want to send HTTP request Use.

On the other hand if you have / correlateout / * map to the servlet for , you should not use it to target mapping , because other All the points are in that context.

Then, your path should be path = "{origin} / {msgtype} / {priority}"

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -