[jira] Created: (CAMEL-1899) camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-1899) camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate

JIRA jira@apache.org
camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate
---------------------------------------------------------------------------

                 Key: CAMEL-1899
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1899
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-spring
    Affects Versions: 2.0-M3
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.0.0


When using camel in XML and you want to unit test or get hold of a producer template using IoC you need to declare it in the Spring XML file and define an id to it such as below

{code}
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <template id="template"/>
        <route>
            <from uri="file://acme/inbox"/>
            <to uri="file://acme/outbox"/>
        </route>
    </camelContext>
{code}

I think we should default define a bean with the id
- template = producer template (often named like this, so instead of naming it producerTemplate)
- consumerTemplate = consumer template

However if there is a <template> tag defined it should not auto register a bean

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1899) camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate

JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53577#action_53577 ]

Claus Ibsen commented on CAMEL-1899:
------------------------------------

That allows you to use a route as
{code}
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="file://acme/inbox"/>
            <to uri="file://acme/outbox"/>
        </route>
    </camelContext>
{code}

And then in your unit test classes to define

{code}
    @Autowired
    private ProducerTemplate template;
{code}

And you are all set

> camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-1899
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1899
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-spring
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> When using camel in XML and you want to unit test or get hold of a producer template using IoC you need to declare it in the Spring XML file and define an id to it such as below
> {code}
>     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>         <template id="template"/>
>         <route>
>             <from uri="file://acme/inbox"/>
>             <to uri="file://acme/outbox"/>
>         </route>
>     </camelContext>
> {code}
> I think we should default define a bean with the id
> - template = producer template (often named like this, so instead of naming it producerTemplate)
> - consumerTemplate = consumer template
> However if there is a <template> tag defined it should not auto register a bean

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-1899) camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1899.
--------------------------------

    Resolution: Fixed

trunk: 803014.

> camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-1899
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1899
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-spring
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> When using camel in XML and you want to unit test or get hold of a producer template using IoC you need to declare it in the Spring XML file and define an id to it such as below
> {code}
>     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>         <template id="template"/>
>         <route>
>             <from uri="file://acme/inbox"/>
>             <to uri="file://acme/outbox"/>
>         </route>
>     </camelContext>
> {code}
> I think we should default define a bean with the id
> - template = producer template (often named like this, so instead of naming it producerTemplate)
> - consumerTemplate = consumer template
> However if there is a <template> tag defined it should not auto register a bean

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1899) camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53583#action_53583 ]

Claus Ibsen commented on CAMEL-1899:
------------------------------------

trunk: 803055.

Will *not* auto register if there are multiple camel contexts as it would render id clashes and also return templates that belongs to another camel context.

> camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-1899
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1899
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-spring
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> When using camel in XML and you want to unit test or get hold of a producer template using IoC you need to declare it in the Spring XML file and define an id to it such as below
> {code}
>     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>         <template id="template"/>
>         <route>
>             <from uri="file://acme/inbox"/>
>             <to uri="file://acme/outbox"/>
>         </route>
>     </camelContext>
> {code}
> I think we should default define a bean with the id
> - template = producer template (often named like this, so instead of naming it producerTemplate)
> - consumerTemplate = consumer template
> However if there is a <template> tag defined it should not auto register a bean

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1899) camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53584#action_53584 ]

Claus Ibsen commented on CAMEL-1899:
------------------------------------

trunk: 803062.

And final fixes so we avoid auto creating template(s) if a regular spring bean with that id already have been defined.

> camel-spring - Should auto register a ProducerTemplate and ConsumerTemplate
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-1899
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1899
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-spring
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> When using camel in XML and you want to unit test or get hold of a producer template using IoC you need to declare it in the Spring XML file and define an id to it such as below
> {code}
>     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>         <template id="template"/>
>         <route>
>             <from uri="file://acme/inbox"/>
>             <to uri="file://acme/outbox"/>
>         </route>
>     </camelContext>
> {code}
> I think we should default define a bean with the id
> - template = producer template (often named like this, so instead of naming it producerTemplate)
> - consumerTemplate = consumer template
> However if there is a <template> tag defined it should not auto register a bean

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.