[
https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039629#comment-13039629
]
Claus Straube edited comment on CAMEL-4015 at 5/26/11 10:53 AM:
----------------------------------------------------------------
I don't agree with "to be able to specify type operation in the uri INSTEAD of
headers". What is the reason that you want to remove the option to have the
flexibility to change to operation on runtime? With the header you can
overwrite the operation or not. As you want. One solution would be to have both
- header plus uri parameter. And the header is overwriting the default behavior
defined inside the uri. I'm not sure if it's worth the effort. One nice side
effect with the header solution is, that you have only one endpoint instance in
the sample above and even in the more "classical" sample below. Instead of 3 if
you have defined the uri as parameter.
{code:java}
...
// keys are missing here
from("direct:insert").setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.PUT_OPERATION)).toF("hazelcast:%sfoo",
HazelcastConstants.MAP_PREFIX);
from("direct:get").setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.GET_OPERATION)).toF("hazelcast:%sfoo",
HazelcastConstants.MAP_PREFIX);
from("direct:delete").setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.DELETE_OPERATION)).toF("hazelcast:%sfoo",
HazelcastConstants.MAP_PREFIX);
...
{code}
"...excepted it is possible to pre-load things and have constant ids (string
often)." This is for me not the default case. This means you have one route per
item in your map. If I would have only two items to preload, I would use a
generic pattern than hard coding the route for each item. So I still see no
case to have the key inside the uri.
was (Author: clausstraube):
I don't agree with "to be able to specify type operation in the uri INSTEAD
of headers". What is the reason that you want to remove the option to have the
flexibility to change to operation on runtime? With the header you can
overwrite the operation or not. As you want. One solution would be to have both
- header plus uri parameter. And the header is overwriting the default behavior
defined inside the uri. I not sure if it's worth the effort. One nice side
effect with the header solution is, that you have only one endpoint instance in
the sample above and even in the more "classical" sample below. Instead of 3 if
you have defined the uri as parameter.
// keys are missing here
from("direct:insert").setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.PUT_OPERATION)).toF("hazelcast:%sfoo",
HazelcastConstants.MAP_PREFIX);
from("direct:get").setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.GET_OPERATION)).toF("hazelcast:%sfoo",
HazelcastConstants.MAP_PREFIX);
from("direct:delete").setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.DELETE_OPERATION)).toF("hazelcast:%sfoo",
HazelcastConstants.MAP_PREFIX);
"...excepted it is possible to pre-load things and have constant ids (string
often)." This is for me not the default case. This means you have one route per
item in your map. If I would have only two items to preload, I would use a
generic pattern than hard coding the route for each item. So I still see no
case to have the key inside the uri.
> camel hazelcast uri format
> --------------------------
>
> Key: CAMEL-4015
> URL: https://issues.apache.org/jira/browse/CAMEL-4015
> Project: Camel
> Issue Type: Improvement
> Components: camel-hazelcast
> Reporter: Romain Manni-Bucau
> Priority: Trivial
>
> It could be nice to be able to specify type operation (and maybe the key for
> map) in the uri instead of headers:
> from("hazelcast:map:foo?operation=get&id=myStringId").to("log:display");
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira