Hi,

I'm trying to run a camel program which gets the data from camel-mqtt
component and insert the data into camel-ignite-cache, however the data is
not inserting into Ignite's cache. There is no any errors while running
this.

I searched for camel-ignite example online but didn't get any.

My code snippet is like this

Ignite ignite = Ignition.start("examples/config/example-ignite.xml");
                
                CacheConfiguration<Integer, String> cfg = new 
CacheConfiguration<>();
                cfg.setCacheMode(CacheMode.PARTITIONED);

                IgniteCache<Integer, String> cache =
ignite.getOrCreateCache("myCacheName");

                IgniteDataStreamer<String, String> pipe =
ignite.dataStreamer("myCacheName");

                CamelStreamer<String, String> streamer = new CamelStreamer<>();
                streamer.setIgnite(ignite);
                streamer.setStreamer(pipe);
                
                CamelContext context = new DefaultCamelContext();  
                try {
                        context.addRoutes(new RouteBuilder() {  
                            @Override
                            public void configure() throws Exception {
                               
from("mqtt:bar?subscribeTopicName=test&host=tcp://localhost:1883")
                                .to("ignite-cache:myCacheName?operation=PUT", 
"1234",
IgniteConstants.IGNITE_CACHE_KEY, "abcd");
                            }
                        });
                } catch (Exception e) {
                        e.printStackTrace();
                }
                
streamer.setEndpointUri("ignite-cache:myCacheName?operation=PUT");
         

Can any one guide me on how to ingest data into Ignite's cache.

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Ignite-Example-tp5800977.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to