In Ignite component , I saw that there is not statement to get the current ignite cluster instance.
I have two separate camelContext and I used ignite component in both of them. But when it starts , it gives IgniteException normally. The error comes from this line:
org.apache.camel.component.ignite.IgniteComponent.doStart() : line 168 for Camel 2.17.0
So I am expecting to have an option for using existing cluster or create a new one in order to run two Ignite Instance in one JVM instance.
Am I missing something or is it like that?
Thx
To start two Ignite nodes within one process you need to give them different names via IgniteConfiguration.setGridName() property. By default they both use 'null' and therefore the exception fails. Please try to set different names and see if it helps.
Related
I'm new to Camel, and have some basic questions which can't found the answers online. Please help and I'm appreciate it.
I have read many example online, and saw bunch example like this:
from(direct:A).to(jms:queue:B)
But didn't see any configuration for them. My question is what will happen if the direct doesn't exist? How about from(jms:queue:A).to(direct:A)? and what about the other components?
For this example, what's the execution order? does it pass the original message to B first, then process and pass to C?
from(direct:A)
.to(jms:B)
.process(something)
.to(jms:C)
Direct is an in memory queue, provided by Camel. Prior it Camel 3, it was bundled with the camel-core module and you would not need any configuration at all in order to use the direct component. However, due to sake of modularity, since Camel 3, direct has been made its own component and in order to use it camel-direct needs to be imported.
Jms on the other hand is a generic component, using which you can implement connectivity to different Jms providers such as ActiveMq(though in Camel activemq has it's own component), IBM MQ, Weblogic JMS server, and others.
For your 1st question, if direct doesn't not exist, you need to import the direct component into your build. If the uri provided to the component is not present, Camel will create its own. This is true for most of the Camel components. One of the most common is the file component, which is used to pick up files from a given directory. If the given directory is not present, Camel is smart enough to create the directory. Obviously, these are default behaviours and you have a lot of control to pick and choose how you want your route to behave.
For your second question, the route will be processed entirely in order, which is, the message will be picked up from the direct:A, then will be sent to jms:B. After that it will be processed using the something processor and will finally be sent to jms:c.
The thing to note here is that the direct:A is just an example to show the syntax of a route. You can use any component which can act as a consumer.
I'm using Azkaban 3.0 and I have it on a server with two executors. I have a simple echo job that I'm running and I'm specifying the executor by setting the setExecutor=id# in the flow parameters. but whenever I run tise job the execution keeps alternating between the two executors although it explicitly specified in the job definition to run on the second executor only.
Do I need to change something in the configurations?
I restarted azkaban with executors but it didn't help.
Thanks in advance!
check this out to know how to configure azaban with multiple executers. . .
http://azkaban.github.io/azkaban/docs/latest/#executor-setup
a got a help from a colleague and he showed me how to solve this issue.
it was solved by deleting the executor.port from azkaban webserver properties file.
I have a list of Esper statements which I would like to run within the Apache Camel flow.
How can I make sure all statements are evaluated for all messages?
Do I need to have a separate route for each Esper statement (i.e. from: esper:// ...)?
Note: Each statement may be yielding a result at a different time (e.g. aggregating over 1 second, another one over 5 seconds, etc).
According to the documentation, each camel route will start a single event processing statement and consume the results. If you have a reason why you must have a single camel route, craft an EPL statement that performs all the desired work (or at least selects the appropriate data for further processing later in the camel pipeline). The alternative, as you suggest, is to stand up multiple camel routes each consuming from an esper component with a different EPL statement. The multiple routes could later be merged into a single route using one of camel's internal queue components (seda, vm, direct, or jms).
There is a two route example with source code here.
I have a requirement to write a code whenever there is a new entry in the JMS queue, I want that entry to be persisted in the MySql database. I read that this is possible using Apache Camel project. Could any one point out to the examples or some documentation related to the same.
Lokesh
Yes, it's rather straight forward. At least the JMS and Database parts.
from("jms:queue:someQueue")
.bean(SomeTransformerBean.class) // transform the message, custom code etc in
.to("sql:insert into FOO X VALUES(#)"); // need to enter some valid SQL statement here
Read more here
http://camel.apache.org/sql-component.html
and here
http://camel.apache.org/jms
Hi i tried to develop an application using IPC in WebSpherePortal using two different war files.Am trying to transfer one bean object,for that i have placed one jar file in ../WebSpherePortal/PortalServer/shared/app. Even am getting class cast exception.Can any one answer this question.
What you attempted will not work. The classloader with WAS works generally so that every application is separated from each others. You can not share any classes because the classloaders will not be able to understand that the two classes - even when loaded from the same jar - are actually the same. What you need to do is to serialize ("implements Serializable", plus ensure that you really do serialize every Object) every Object before you share them.
Some approaches you could generally take are ICE or Spring Remoting.