camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-8537) CamelHazelcast component should create its own HZ instance only if it's not provided
Date Wed, 25 Mar 2015 14:03:52 GMT

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

Claus Ibsen commented on CAMEL-8537:
------------------------------------

Thanks I am pushing the code changes. Do you want to help update the wiki? 

To do that read here
http://camel.apache.org/how-do-i-edit-the-website.html

It requires signing an ICLA which the link explains about.

> CamelHazelcast component should create its own HZ instance only if it's not provided
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-8537
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8537
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-hazelcast
>    Affects Versions: 2.15.0
>            Reporter: ayache khettar
>              Labels: patch
>             Fix For: 2.16.0
>
>
> Hi
> Currently Hazelcast component creates its own HZ instance regardless if a reference to
a HZ instance is provided or not. So in the case of a reference of HZ instance is provided,
the one created by the component does not get shutdown - see below code snippet, doesn't get
shutdown. So one end up with multipole instances.
> I believe the component should not create its own instance at the doStart() method. It
should first check if a reference to HZ instance is provided, if yes then use it and if not
create its own. 
> I have made the changes to reflect the correct behaviour described above. The changes
will make sure only one instance of HZ is created. Also, added the ability to reference HZ
instance by its name.
> {panel:title=What remains?|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1|bgColor=#FFFFCE}
> * Update the wiki to show how to reference HZ by its name
> * Update the wiki to show the newly introduced parameter (hazelcastInstanceName)
> * Update the wiki to ideally show an example of how to publish HZ instance as an OSGI
service for reuse by multiple bundles.
> {panel}
> {panel:title=Changes made|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1|bgColor=#FFFFCE}
> * No longer the component creates its own HZ instance in doStart() method.
> * When the component is initialised, only one instance is either been created or use
the referenced on in the endpoint.
> * Ability to reference HZ instance by its name. This will serve the use case whereby
the hazelcast cluster is running remotely or not part of the camel context.
> {panel}
> {code:title=HazelcastComponent.java|borderStyle=solid}
>  @Override
>     public void doStart() throws Exception {
>         super.doStart();
>         if (hazelcastInstance == null) {
>             createOwnInstance = true;
>             hazelcastInstance = createOwnInstance();
>         }
>     }
> {code}
> I have created a pull request for this, details can be seen here: https://github.com/apache/camel/pull/443



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message