Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11382

Creating IgniteComponent from Ignite Instance throws IllegalStateException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.19.0
    • 2.19.1, 2.20.0
    • camel-ignite
    • None
    • Unknown

    Description

      Creating an IgniteComponent from configuration works fine, but when I try and create one from an existing Ignite instance it throws an IllegalStateException when starting the component: "No configuration resource or IgniteConfiguration was provided to the Ignite component."

      Looking at the code here it appears the lifecycleMode is ignored as it is only set to COMPONENT_MANAGED and cannot be altered outside of the class.

      The following patch sets the lifecycleMode USER_MANAGED when an ignite instance is set, which appears to resolve the problem.

        diff --git a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java
        index eaf6583..e9efc79 100644
        --- a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java
        +++ b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java
        @@ -121,6 +108,7 @@
              */
             public void setIgnite(Ignite ignite) {
                 this.ignite = ignite;
        +        lifecycleMode = IgniteLifecycleMode.USER_MANAGED;
             }
         
             /**
      

      (github pull request to follow)

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              g.hodgson Gary Hodgson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: