You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Steve Storck (JIRA)" <ji...@apache.org> on 2016/07/13 21:59:20 UTC
[jira] [Comment Edited] (CAMEL-10139) Multiple verbs for same
resource not working in camel-undertow (rest dsl)
[ https://issues.apache.org/jira/browse/CAMEL-10139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375851#comment-15375851 ]
Steve Storck edited comment on CAMEL-10139 at 7/13/16 9:58 PM:
---------------------------------------------------------------
Here is my RouteBuilder configuration:
{code}
restConfiguration()
.component("undertow")
.host("localhost").port("8181")
.enableCORS(true);
rest("/timesheet")
.post("/{timesheetId}")
.produces(MediaType.TEXT_PLAIN)
.route()
.bean("timesheetService", "updateTimesheet")
.endRest()
.get("/{timesheetId}")
.produces(MediaType.TEXT_PLAIN)
.route()
.bean("timesheetService", "getTimesheetById");
{code}
Here is the relevant portion of the log when I start my wildfly-swarm deployment:
{code}
2016-07-13 17:01:46,730 INFO [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-8) Loaded 198 type converters
2016-07-13 17:01:46,743 INFO [org.apache.camel.cdi.CdiCamelExtension] (MSC service thread 1-8) Camel CDI is starting Camel context [cdi-context]
2016-07-13 17:01:46,743 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Apache Camel 2.17.1 (CamelContext: cdi-context) is starting
2016-07-13 17:01:46,745 INFO [org.apache.camel.management.ManagedManagementStrategy] (MSC service thread 1-8) JMX is enabled
2016-07-13 17:01:46,794 INFO [org.wildfly.extension.camel] (MSC service thread 1-8) Camel context starting: cdi-context
2016-07-13 17:01:46,794 INFO [org.wildfly.extension.camel] (MSC service thread 1-2) Bound camel naming object: java:jboss/camel/context/cdi-context
2016-07-13 17:01:46,811 INFO [org.apache.camel.impl.DefaultRuntimeEndpointRegistry] (MSC service thread 1-8) Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2016-07-13 17:01:46,863 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
2016-07-13 17:01:46,863 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2016-07-13 17:01:46,895 INFO [org.apache.camel.component.undertow.UndertowRegistry] (MSC service thread 1-8) Adding consumer to consumerRegistry: http://localhost:8181/timesheet/%7BtimesheetId%7D
2016-07-13 17:01:46,898 INFO [org.wildfly.extension.camel] (MSC service thread 1-8) Add Camel endpoint: http://[::]:8181/timesheet/{timesheetId}
2016-07-13 17:01:46,898 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Route: route1 started and consuming from: Endpoint[http://localhost:8181/timesheet/%7BtimesheetId%7D?httpMethodRestrict=POST%2COPTIONS&optionsEnabled=true]
2016-07-13 17:01:46,899 INFO [org.apache.camel.component.undertow.UndertowRegistry] (MSC service thread 1-8) Adding consumer to consumerRegistry: http://localhost:8181/timesheet/%7BtimesheetId%7D
2016-07-13 17:01:46,899 INFO [org.wildfly.extension.camel] (MSC service thread 1-8) Add Camel endpoint: http://[::]:8181/timesheet/{timesheetId}
2016-07-13 17:01:46,899 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Route: route2 started and consuming from: Endpoint[http://localhost:8181/timesheet/%7BtimesheetId%7D?httpMethodRestrict=GET%2COPTIONS&optionsEnabled=true]
2016-07-13 17:01:46,899 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Total 2 routes, of which 2 are started.
2016-07-13 17:01:46,900 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Apache Camel 2.17.1 (CamelContext: cdi-context) started in 0.156 seconds
2016-07-13 17:01:47,254 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 7) RESTEASY002225: Deploying javax.ws.rs.core.Application: class org.wildfly.swarm.generated.WildFlySwarmDefaultJAXRSApplication
2016-07-13 17:01:47,256 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 7) WFLYUT0021: Registered web context: /
2016-07-13 17:01:47,257 INFO [org.wildfly.extension.camel] (ServerService Thread Pool -- 7) Add Camel endpoint: http://[::]:8181
2
{code}
was (Author: steve973):
Here is the relevant portion of the log when I start my wildfly-swarm deployment:
{code}
2016-07-13 17:01:46,730 INFO [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-8) Loaded 198 type converters
2016-07-13 17:01:46,743 INFO [org.apache.camel.cdi.CdiCamelExtension] (MSC service thread 1-8) Camel CDI is starting Camel context [cdi-context]
2016-07-13 17:01:46,743 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Apache Camel 2.17.1 (CamelContext: cdi-context) is starting
2016-07-13 17:01:46,745 INFO [org.apache.camel.management.ManagedManagementStrategy] (MSC service thread 1-8) JMX is enabled
2016-07-13 17:01:46,794 INFO [org.wildfly.extension.camel] (MSC service thread 1-8) Camel context starting: cdi-context
2016-07-13 17:01:46,794 INFO [org.wildfly.extension.camel] (MSC service thread 1-2) Bound camel naming object: java:jboss/camel/context/cdi-context
2016-07-13 17:01:46,811 INFO [org.apache.camel.impl.DefaultRuntimeEndpointRegistry] (MSC service thread 1-8) Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2016-07-13 17:01:46,863 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
2016-07-13 17:01:46,863 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2016-07-13 17:01:46,895 INFO [org.apache.camel.component.undertow.UndertowRegistry] (MSC service thread 1-8) Adding consumer to consumerRegistry: http://localhost:8181/timesheet/%7BtimesheetId%7D
2016-07-13 17:01:46,898 INFO [org.wildfly.extension.camel] (MSC service thread 1-8) Add Camel endpoint: http://[::]:8181/timesheet/{timesheetId}
2016-07-13 17:01:46,898 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Route: route1 started and consuming from: Endpoint[http://localhost:8181/timesheet/%7BtimesheetId%7D?httpMethodRestrict=POST%2COPTIONS&optionsEnabled=true]
2016-07-13 17:01:46,899 INFO [org.apache.camel.component.undertow.UndertowRegistry] (MSC service thread 1-8) Adding consumer to consumerRegistry: http://localhost:8181/timesheet/%7BtimesheetId%7D
2016-07-13 17:01:46,899 INFO [org.wildfly.extension.camel] (MSC service thread 1-8) Add Camel endpoint: http://[::]:8181/timesheet/{timesheetId}
2016-07-13 17:01:46,899 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Route: route2 started and consuming from: Endpoint[http://localhost:8181/timesheet/%7BtimesheetId%7D?httpMethodRestrict=GET%2COPTIONS&optionsEnabled=true]
2016-07-13 17:01:46,899 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Total 2 routes, of which 2 are started.
2016-07-13 17:01:46,900 INFO [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-8) Apache Camel 2.17.1 (CamelContext: cdi-context) started in 0.156 seconds
2016-07-13 17:01:47,254 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 7) RESTEASY002225: Deploying javax.ws.rs.core.Application: class org.wildfly.swarm.generated.WildFlySwarmDefaultJAXRSApplication
2016-07-13 17:01:47,256 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 7) WFLYUT0021: Registered web context: /
2016-07-13 17:01:47,257 INFO [org.wildfly.extension.camel] (ServerService Thread Pool -- 7) Add Camel endpoint: http://[::]:8181
2
{code}
> Multiple verbs for same resource not working in camel-undertow (rest dsl)
> -------------------------------------------------------------------------
>
> Key: CAMEL-10139
> URL: https://issues.apache.org/jira/browse/CAMEL-10139
> Project: Camel
> Issue Type: Bug
> Components: camel-undertow
> Affects Versions: 2.17.1
> Reporter: Steve Storck
>
> The camel-undertow component does not seem to support multiple verbs for the same resource when using the rest dsl.
> {code:title=Rest DSL Example|borderStyle=solid}
> rest("/example")
> .get("{pathParamHere}").to("bean:exampleBean?method=handleGet")
> .put("{pathParamHere}").to("bean:exampleBean?method=handlePut");
> {code}
> The above example will result in only the "put" verb working, and the "get" resource not found.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)