A blog about my daily tech ramblings.

Friday, 9 August 2013

Using External Properties in Apache Karaf [Fuse ESB]

August 09, 2013 Posted by Unknown , , , 5 comments

Introduction

In this example we will see how to use an external property file in Fuse ESB / Apache Karaf.

Creating a configuration file

Create a config file named sample.cfg in FUSE_HOME/etc with the following content.

Spring Configuration


Blueprint 


Note : The default blueprint placeholder syntax (accessing the blueprint properties directly) is ${Key}. Hence, outside the scope of a camelContext element, the placeholder syntax you must use is ${Key}. Whereas, inside the scope of a camelContext element, the placeholder syntax you must use is {{Key}}.


Camel Route

5 comments:

  1. I tried using property from cfg file, same way you have explained, but it not loading property... m still getting exception in this... is there anything i am missing...

    ReplyDelete
  2. Hi Sachin,

    I have recently started working on fuse esb, osgi.. i have some more question regarding osgi bundling and fuse..
    i.e. i am not able to import resource files from dependencies projects although i am using etc..
    can i some communication to you regarding this... ur mail, or group on stack overflow..

    ReplyDelete
  3. Can you post the exception stacktrace here ?

    ReplyDelete
  4. I noticed that you are naming the file sample.cfg and in your Spring XML you have:


    However in your Blueprint example you have:


    Does the name of the file have to match up with the persistent-id? For Spring? For Blueprint?

    Thanks,

    Joe Kampf

    ReplyDelete
  5. Team,

    Do we have any sample spring configuration for apache karaf. It would be really good if we can configure the karaf configuration in the spring xml file.

    ReplyDelete