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:27:20 UTC
[jira] [Commented] (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=15375789#comment-15375789 ]
Steve Storck commented on CAMEL-10139:
--------------------------------------
It looks like the problem is in the UndertowRegistry class:
{code}
public void registerConsumer(UndertowConsumer consumer) {
UndertowEndpoint endpoint = consumer.getEndpoint();
URI httpUri = endpoint.getHttpURI();
if (host != null && !host.equals(httpUri.getHost())) {
throw new IllegalArgumentException("Cannot register UndertowConsumer on different host and same port: {}" + host + " " + httpUri.getHost());
} else {
host = httpUri.getHost();
}
LOG.info("Adding consumer to consumerRegistry: {}", httpUri);
consumersRegistry.put(endpoint.getEndpointUri(), consumer);
if (sslContext != null && endpoint.getSslContext() != null) {
throw new IllegalArgumentException("Cannot register UndertowConsumer with different SSL config");
}
}
{code}
When the same path/resource (as an endpoint uri) is added for different verbs, they are put into the registry with the same key. Therefore, the last one wins, which is the behavior that I am seeing.
> 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)