You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2011/05/26 10:41:48 UTC

[jira] [Created] (CAMEL-4015) camel hazelcast uri format

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

[jira] [Issue Comment Edited] (CAMEL-4015) camel hazelcast uri format

Posted by "Richard Kettelerij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044513#comment-13044513 ] 

Richard Kettelerij edited comment on CAMEL-4015 at 6/5/11 1:03 PM:
-------------------------------------------------------------------

I think we're all on the same page here. Header-based configuration as currently available is nice, but supporting both headers and URI parameters would be even better. Most importantly because it's inline with other components offered by Camel.

When one knows upfront what operation/id is required (as in Romain's use case) then it's more convenient to specify this through a parameter in the URI. A header on the other hand is more suitable when the operation/id is determined dynamically by another component in the route (e.g. a custom processor or as part of a web service request). In this case the header will override the URI parameter if present.

Feel free to provide a patch if you wish to see this implemented.

      was (Author: rkettelerij):
    I think we're all on the same page here. Header-based configuration as currently available is nice, but supporting both headers and URI parameters would be even better. Most importantly because it's inline with other components offered by Camel.

When one knows upfront what operation/id is required (as in Romain's use case) then it's more convenient to specify this through a parameter in the URI. A header on the other hand is more suitable when the operation/id is determined dynamically by another component in the route (e.g. a custom processor or as part of a web service request). In this case the header will override the URI parameter if present.

Feel free to provide a patch if you wish this to be implemented.
  
> 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

[jira] [Commented] (CAMEL-4015) camel hazelcast uri format

Posted by "Richard Kettelerij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044513#comment-13044513 ] 

Richard Kettelerij commented on CAMEL-4015:
-------------------------------------------

I think we're all on the same page here. Header-based configuration as currently available is nice, but supporting both headers and URI parameters would be even better. Most importantly because it's inline with other components offered by Camel.

When one knows upfront what operation/id is required (as in Romain's use case) then it's more convenient to specify this through a parameter in the URI. A header on the other hand is more suitable when the operation/id is determined dynamically by another component in the route (e.g. a custom processor or as part of a web service request). In this case the header will override the URI parameter if present.

Feel free to provide a patch if you wish this to be implemented.

> 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

[jira] [Commented] (CAMEL-4015) camel hazelcast uri format

Posted by "Claus Straube (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039603#comment-13039603 ] 

Claus Straube commented on CAMEL-4015:
--------------------------------------

I'm pretty sure it'll no good idea to add the id (key) to the url, because this value changes at every call. Other the operation. The reason why we've choosen to set the operation into the header is the greater flexibility. Only if the operation is a header variable you can change it on runtime. So you can do something like this:

// keys are missing here
from("direct:insert").setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.PUT_OPERATION)).to("seda:x");
from("direct:get").setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.GET_OPERATION)).inOut("seda:x");
from("direct:delete").setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.DELETE_OPERATION)).to("seda:x");

from("seda:x").toF("hazelcast:%sfoo", HazelcastConstants.MAP_PREFIX);



> 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

[jira] [Commented] (CAMEL-4015) camel hazelcast uri format

Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039644#comment-13039644 ] 

Romain Manni-Bucau commented on CAMEL-4015:
-------------------------------------------

I don't want to remove the header configuration, it is pretty nice but i want to be able to do it with uri (as almost all camel components). However i find it simpler to configure the operation in the uri and it is more "sexy" and consitent with camel IMHO.

For the id i don't say it is necessary but it is more consistent and imagine you load almost constants datas (currencies for example), you know the id and you can hard code (almost ;)) it in your route.



> 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

[jira] [Commented] (CAMEL-4015) camel hazelcast uri format

Posted by "Romain Manni-Bucau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039619#comment-13039619 ] 

Romain Manni-Bucau commented on CAMEL-4015:
-------------------------------------------

i don't understand your example you separated the operations so you could set it in the uri. I know it is nice to override it using headers and it can be useful f course but or me it si not the default case.

For the id i'm agree excepted it is possible to pre-load things and have constant ids (string often).

So i still think this issue should be solved.

> 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

[jira] [Issue Comment Edited] (CAMEL-4015) camel hazelcast uri format

Posted by "Claus Straube (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Commented] (CAMEL-4015) camel hazelcast uri format

Posted by "Claus Straube (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039629#comment-13039629 ] 

Claus Straube commented on CAMEL-4015:
--------------------------------------

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