Skip to content

Instantly share code, notes, and snippets.

@jvz
Created May 2, 2016 15:04
Show Gist options
  • Save jvz/3a825582f8794cce4b1fff85705bdd6c to your computer and use it in GitHub Desktop.
Save jvz/3a825582f8794cce4b1fff85705bdd6c to your computer and use it in GitHub Desktop.
Blueprint file for configuring Hazelcast in Camel
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<ext:property-placeholder/>
<bean id="hazelcastInstance" class="com.hazelcast.core.Hazelcast" factory-method="newHazelcastInstance" destroy-method="shutdown">
<argument>
<bean class="com.hazelcast.config.FileSystemXmlConfig">
<argument value="${karaf.home}/etc/hazelcast.xml"/>
</bean>
</argument>
</bean>
<service ref="hazelcastInstance" interface="com.hazelcast.core.HazelcastInstance">
<service-properties>
<entry key="name" value="hazelcastInstance"/>
<entry key="osgi.jndi.service.name" value="hazelcast/instance"/>
</service-properties>
</service>
<bean id="hazelcast" class="org.apache.camel.component.hazelcast.HazelcastComponent">
<property name="hazelcastInstance" ref="hazelcastInstance"/>
</bean>
<service ref="hazelcast" interface="org.apache.camel.Component">
<service-properties>
<entry key="name" value="hazelcast"/>
<entry key="osgi.jndi.service.name" value="camel/hazelcast"/>
</service-properties>
</service>
<bean id="hazelcastmq" class="org.mpilone.hazelcastmq.camel.HazelcastMQCamelComponent">
<argument>
<bean class="org.mpilone.hazelcastmq.camel.HazelcastMQCamelConfig">
<argument>
<bean class="org.mpilone.hazelcastmq.core.HazelcastMQ" factory-method="newHazelcastMQInstance">
<argument>
<bean class="org.mpilone.hazelcastmq.core.HazelcastMQConfig">
<argument ref="hazelcastInstance"/>
</bean>
</argument>
</bean>
</argument>
</bean>
</argument>
</bean>
<service ref="hazelcastmq" interface="org.apache.camel.Component">
<service-properties>
<entry key="name" value="hazelcastmq"/>
<entry key="osgi.jndi.service.name" value="camel/hazelcastmq"/>
</service-properties>
</service>
</blueprint>
@Vinayvitkm
Copy link

Hi Matt,
I am trying to implement Hazelcast using blueprint, as per your blueprint above,what will be there in hazelcast.xml.
can you please elaborate here. does it contains map configurations?

thanks
Vini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment