You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Christian Schneider (Created) (JIRA)" <ji...@apache.org> on 2011/10/20 19:05:10 UTC

[jira] [Created] (CAMEL-4565) Allow to send messages using a user supplied pojo interface

Allow to send messages using a user supplied pojo interface
-----------------------------------------------------------

                 Key: CAMEL-4565
                 URL: https://issues.apache.org/jira/browse/CAMEL-4565
             Project: Camel
          Issue Type: Improvement
            Reporter: Christian Schneider


The basic requirement is that we want to send a user defined object to a camel endpoint. The user code for sending the object should not contain any camel code.

So imagine a simple DTO like Person with properties name and age. I would like to use an interface like

interface PersonSender {
  void send(Person person);
}

So in the use code I code get an implementation injected that I simply could call with 
sender.send(person);

So this is quite similar to our Pojo Messaging @Produce but I don´t want to send a BeanInvocation. Instead I would like to just have the Person object in the body. Ideally this should also support request / response if there is a return type.

Additionally it should be configurable if it should send aynschronously or synchronously.

Optionally we may also support a handler or Future for the response.

To get the interface implementation we should support up to three variants.
1) Create the dynamic proxy programmatically
2) Define the proxy thiough a spring bean
3) Create and inject the proxy using the @Produce annotation (we will need a flag to switch behaviour or use a second annotation)



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CAMEL-4565) Allow to send messages using a user supplied pojo interface

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

Claus Ibsen commented on CAMEL-4565:
------------------------------------

I think we already support this. Check out
http://camel.apache.org/using-camelproxy.html

But there may be a missing piece somewhere, but I suggest to check that page, and see if there is something missing.

                
> Allow to send messages using a user supplied pojo interface
> -----------------------------------------------------------
>
>                 Key: CAMEL-4565
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4565
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> The basic requirement is that we want to send a user defined object to a camel endpoint. The user code for sending the object should not contain any camel code.
> So imagine a simple DTO like Person with properties name and age. I would like to use an interface like
> interface PersonSender {
>   void send(Person person);
> }
> So in the use code I code get an implementation injected that I simply could call with 
> sender.send(person);
> So this is quite similar to our Pojo Messaging @Produce but I don´t want to send a BeanInvocation. Instead I would like to just have the Person object in the body. Ideally this should also support request / response if there is a return type.
> Additionally it should be configurable if it should send aynschronously or synchronously.
> Optionally we may also support a handler or Future for the response.
> To get the interface implementation we should support up to three variants.
> 1) Create the dynamic proxy programmatically
> 2) Define the proxy thiough a spring bean
> 3) Create and inject the proxy using the @Produce annotation (we will need a flag to switch behaviour or use a second annotation)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CAMEL-4565) Allow to send messages using a user supplied pojo interface

Posted by "David J. M. Karlsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132587#comment-13132587 ] 

David J. M. Karlsen commented on CAMEL-4565:
--------------------------------------------

True - actually I use exactly this technique. All you have to do is to put in:
{noformat}
convertBodyTo type="theArgumentType"
{noformat}
for 1-argument.

                
> Allow to send messages using a user supplied pojo interface
> -----------------------------------------------------------
>
>                 Key: CAMEL-4565
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4565
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> The basic requirement is that we want to send a user defined object to a camel endpoint. The user code for sending the object should not contain any camel code.
> So imagine a simple DTO like Person with properties name and age. I would like to use an interface like
> interface PersonSender {
>   void send(Person person);
> }
> So in the use code I code get an implementation injected that I simply could call with 
> sender.send(person);
> So this is quite similar to our Pojo Messaging @Produce but I don´t want to send a BeanInvocation. Instead I would like to just have the Person object in the body. Ideally this should also support request / response if there is a return type.
> Additionally it should be configurable if it should send aynschronously or synchronously.
> Optionally we may also support a handler or Future for the response.
> To get the interface implementation we should support up to three variants.
> 1) Create the dynamic proxy programmatically
> 2) Define the proxy thiough a spring bean
> 3) Create and inject the proxy using the @Produce annotation (we will need a flag to switch behaviour or use a second annotation)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CAMEL-4565) Allow to send messages using a user supplied pojo interface

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

Christian Schneider commented on CAMEL-4565:
--------------------------------------------

Looks like at least for the proxy the requirements should be met according to the documentation. I will test this and close the ticket if it simply works.
                
> Allow to send messages using a user supplied pojo interface
> -----------------------------------------------------------
>
>                 Key: CAMEL-4565
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4565
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> The basic requirement is that we want to send a user defined object to a camel endpoint. The user code for sending the object should not contain any camel code.
> So imagine a simple DTO like Person with properties name and age. I would like to use an interface like
> interface PersonSender {
>   void send(Person person);
> }
> So in the use code I code get an implementation injected that I simply could call with 
> sender.send(person);
> So this is quite similar to our Pojo Messaging @Produce but I don´t want to send a BeanInvocation. Instead I would like to just have the Person object in the body. Ideally this should also support request / response if there is a return type.
> Additionally it should be configurable if it should send aynschronously or synchronously.
> Optionally we may also support a handler or Future for the response.
> To get the interface implementation we should support up to three variants.
> 1) Create the dynamic proxy programmatically
> 2) Define the proxy thiough a spring bean
> 3) Create and inject the proxy using the @Produce annotation (we will need a flag to switch behaviour or use a second annotation)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CAMEL-4565) Allow to send messages using a user supplied pojo interface

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

Christian Schneider commented on CAMEL-4565:
--------------------------------------------

The ProxyHelper seems to always create a BeanInvocation. So I think we are not already there. I now work out a prototype of a InvocationHandler for
pojo messaging.
                
> Allow to send messages using a user supplied pojo interface
> -----------------------------------------------------------
>
>                 Key: CAMEL-4565
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4565
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> The basic requirement is that we want to send a user defined object to a camel endpoint. The user code for sending the object should not contain any camel code.
> So imagine a simple DTO like Person with properties name and age. I would like to use an interface like
> interface PersonSender {
>   void send(Person person);
> }
> So in the use code I code get an implementation injected that I simply could call with 
> sender.send(person);
> So this is quite similar to our Pojo Messaging @Produce but I don´t want to send a BeanInvocation. Instead I would like to just have the Person object in the body. Ideally this should also support request / response if there is a return type.
> Additionally it should be configurable if it should send aynschronously or synchronously.
> Optionally we may also support a handler or Future for the response.
> To get the interface implementation we should support up to three variants.
> 1) Create the dynamic proxy programmatically
> 2) Define the proxy thiough a spring bean
> 3) Create and inject the proxy using the @Produce annotation (we will need a flag to switch behaviour or use a second annotation)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira