{"id":19405650,"url":"https://github.com/johnament/injectahvent","last_synced_at":"2026-06-17T19:02:04.397Z","repository":{"id":11173217,"uuid":"13548649","full_name":"johnament/injectahvent","owner":"johnament","description":"A lightweight CDI Integration for Apache Camel, forwarding Exchanges and Bodies as CDI events.","archived":false,"fork":false,"pushed_at":"2013-10-21T01:21:18.000Z","size":176,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-25T00:47:19.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnament.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-13T23:36:55.000Z","updated_at":"2013-10-21T01:21:20.000Z","dependencies_parsed_at":"2022-08-30T20:51:34.293Z","dependency_job_id":null,"html_url":"https://github.com/johnament/injectahvent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnament/injectahvent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnament%2Finjectahvent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnament%2Finjectahvent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnament%2Finjectahvent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnament%2Finjectahvent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnament","download_url":"https://codeload.github.com/johnament/injectahvent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnament%2Finjectahvent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34461618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T11:38:59.893Z","updated_at":"2026-06-17T19:02:04.381Z","avatar_url":"https://github.com/johnament.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"injectahvent\n============\n\nA lightweight CDI Integration for Apache Camel, forwarding Exchanges and Bodies as CDI events.\n\n[![Build Status](https://travis-ci.org/johnament/injectahvent.png)](https://travis-ci.org/johnament/injectahvent)\n\n## A word to the wise\n\nThe library is right now in early Alpha.  As such, API is ugly and needs to be cleaned up.  Please feel free to leave [an issue](https://github.com/johnament/injectahvent/issues) with feedback.\n\n## Using the Library\n\nThere are two components that you can setup.  The first is a `CDIExchangeProcessor` which allows you to register an event emitter that when messages are handed to a queue, a CDI event will be fired based on your configured qualifiers.  Both the `body` and `Exchange` objects will get fired, but you can turn one or the other off as needed.\n\nThe usage of events requires setting up a `CDIExchangeProcessor` that uses a provided `Configuration` to determine what qualifiers should be observed for forwarding events to Camel.\n\nTo register it, simply add it to your `CamelContext`\n\n            RouteBuilder rb = new RouteBuilder() {\n                @Override\n                public void configure() throws Exception {\n                    AnnotationLiteral\u003cSendable\u003e sendable = new AnnotationLiteral\u003cSendable\u003e(){};\n                    Configuration config = ConfigurationBuilder.builder().addQualifiers(sendable).beanManager(beanManager).fireBody().fireExchange().build();\n                    super.from(\"direct://foo\").routeId(\"directFoo\").process(new CDIExchangeProcessor(config));\n                }\n            };\n\nThis will register a new event emitter that fires messages for data that comes via the queue `direct://foo` to fire an event equivalent to `@Inject @Sendable Event\u003cObject\u003e objectEvent;`\n\nThe second is support for a drop in replacement of `ProducerTemplate` that is focused on CDI events.  This allows you to fire a CDI event and translate it into a Camel route.\n\nThis requires some additional steps, namely you need to create a CDI Extension that extends `AbstractRoutingExtension` which will allow you to register the necessary Routes via CDI.\n\nInternally this adds new CDI `ObserverMethod`s that will listen fot the configured types and send a message to a Camel route.\n\n    @Override\n    protected CamelContext getCamelContext(final BeanManager beanManager) throws Exception {\n        // add code that creates or retrieves your CamelContext.\n        return camelContext;\n    }\n\n    @Override\n    protected void createRoutes() {\n        super.addToAliased(\"direct://foo\", \"fooDirect\");\n    }\n    \nThis area still needs some work to allow delayed start up of routes, adding in callbacks for when to start the CamelContext and when to stop it.\n\n## Gotchas\n\nOne criticism I have for this approach is that CDI events are essentially topics, not queues.  Many receivers will get the event, if there are multiple registered.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnament%2Finjectahvent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnament%2Finjectahvent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnament%2Finjectahvent/lists"}