You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Łukasz Dywicki (JIRA)" <ji...@apache.org> on 2012/06/28 12:05:42 UTC

[jira] [Created] (CAMEL-5408) Extend CDI component with support for events

Łukasz Dywicki created CAMEL-5408:
-------------------------------------

             Summary: Extend CDI component with support for events
                 Key: CAMEL-5408
                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
             Project: Camel
          Issue Type: New Feature
            Reporter: Łukasz Dywicki


Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Updated] (CAMEL-5408) Extend CDI component with support for events

Posted by "Łukasz Dywicki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Łukasz Dywicki updated CAMEL-5408:
----------------------------------

    Attachment: CAMEL-5408.patch

Patch supporting both - consumer and provider. Consumer is implemented very similar to quartz. It requires CAMEL-5447 and CAMEL-5448 to be present in working tree.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Updated] (CAMEL-5408) Extend CDI component with support for events

Posted by "Łukasz Dywicki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Łukasz Dywicki updated CAMEL-5408:
----------------------------------

    Attachment:     (was: CAMEL-5408.patch)
    
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Łukasz Dywicki commented on CAMEL-5408:
---------------------------------------

Submitted second version of component with support for consumption of events. Events must have a @Event qualifier or implement empty CamelEvent interface to be received. Path changes a bit initialization, Consumer and Producer instance is injected directly to Endpoint instance. Creation of new instance is on CDI side.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Assigned] (CAMEL-5408) Extend CDI component with support for events

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard reassigned CAMEL-5408:
----------------------------------------

    Assignee: Charles Moulliard  (was: Hadrian Zbarcea)
    
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Charles Moulliard
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5408) Extend CDI component with support for events

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

Łukasz Dywicki commented on CAMEL-5408:
---------------------------------------

Please ignore second patch and stay with producer for now. I need reorganize component to get notifications handled in right way without breaking camel semantics.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Updated] (CAMEL-5408) Extend CDI component with support for events

Posted by "Łukasz Dywicki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Łukasz Dywicki updated CAMEL-5408:
----------------------------------

    Component/s: camel-cdi
    
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Work started] (CAMEL-5408) Extend CDI component with support for events

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-5408 started by Hadrian Zbarcea.

> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Hadrian Zbarcea commented on CAMEL-5408:
----------------------------------------

Thanks Lukasz, that's better.

I'd suggest doing that as a separate jira. I will take care of your first patch and mark this as resolved.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Henryk Konsek commented on CAMEL-5408:
--------------------------------------

Yeah, I see that CDI annotations are more complex than Guava's events systems (which is based on classes hierarchy). This indeed makes consumer more complicated.

I'll try to look at consumer issues later - maybe I'll figure out how to implement it.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Henryk Konsek commented on CAMEL-5408:
--------------------------------------

What about making CdiEventConsumer an asynchronous one? You could do this in Consumer processor's setter (as I correctly understand how CDI works).

I'd be something like:

private AsyncProcessor processor;

public void setProcessor(Processor processor) {
  this.processor = AsyncProcessorConverterHelper.convert(processor);
}

private void handleEvent(Object event) throws Exception {
  if (isStarted()) {
    Exchange exchange = endpoint.createExchange();
    exchange.getIn().setBody(event);
    processor.process(exchange, new AsyncCallback() {
                @Override
                public void done(boolean doneSync) {
                    // noop
                }
    });
  } else {
     logger.warn("Camel received event before starting the consumer. Event {} will be ignored", event);
  }
}
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Łukasz Dywicki commented on CAMEL-5408:
---------------------------------------

At this moment I was unable to register camel consumer in CDI registry with given type which causes bad design (component would be receiving side, not consumer itself).
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Henryk Konsek commented on CAMEL-5408:
--------------------------------------

What about adding an asynchronous CDI event consumer? It could work similarly to the Guava EventBus consumer [1].

from("cdi-event:///?eventClass=com.foo.MyEvent").to("mock:consumedFromCdi");

[1] http://camel.apache.org/guava-eventbus.html
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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-5408) Extend CDI component with support for events

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

Henryk Konsek commented on CAMEL-5408:
--------------------------------------

Ok, maybe instead of creating AsyncProcessor in setProcessor, you could do it in doStart().
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Assigned] (CAMEL-5408) Extend CDI component with support for events

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea reassigned CAMEL-5408:
--------------------------------------

    Assignee: Hadrian Zbarcea
    
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Updated] (CAMEL-5408) Extend CDI component with support for events

Posted by "Łukasz Dywicki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Łukasz Dywicki updated CAMEL-5408:
----------------------------------

    Attachment: CAMEL-5408.patch

Proposed implementation.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Updated] (CAMEL-5408) Extend CDI component with support for events

Posted by "Łukasz Dywicki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Łukasz Dywicki updated CAMEL-5408:
----------------------------------

    Attachment:     (was: CAMEL-5408-2.patch)
    
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-cdi
>            Reporter: Łukasz Dywicki
>            Assignee: Hadrian Zbarcea
>         Attachments: CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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] [Updated] (CAMEL-5408) Extend CDI component with support for events

Posted by "Łukasz Dywicki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Łukasz Dywicki updated CAMEL-5408:
----------------------------------

    Attachment: CAMEL-5408-2.patch

Second version of patch which allows to consume events.
                
> Extend CDI component with support for events
> --------------------------------------------
>
>                 Key: CAMEL-5408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5408
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Łukasz Dywicki
>         Attachments: CAMEL-5408-2.patch, CAMEL-5408.patch
>
>
> Camel-cdi integration allows to use beans registered in CDI registry. CDI supports also event mechanism which can be useful in many cases. Provided patch allows camel produce new CDI events.

--
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