Re: Optional sync for Netty
On Tue, May 6, 2014 at 7:07 PM, Charles Moulliard wrote: > s optional, what did you plan to return to your client > calling your TCP Server exposed by nett There is a situation when my application is failed to get response from a third party, the client must also get the same condition. -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Optional sync for Netty
Hi All Is it possible to make response to be optional in Netty component? The following routes still make all the response sent back to its clients, regardless the body is. ${body} == 'intan' Thanks -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Fastest Data Holder
Passing a JSON object across many processors can be costly too. Since the processors usually parse the object so that they can evaluate its value or add new values to it. I think for the case in the same JVM, it's OK to use Java objects like java.util.Map. On May 2, 2014 1:05 AM, "kraythe ." wrote: > The question of efficiency should be thought of in an overall manner. Sure, > the map is faster but when we add on all the serialization, is it really > faster? JSON might be slower on access but the lack of needing to serialize > it all the time has its benefits. This is important if the message will be > crossing through JMS or some other means. > > However there is a third option If the data is really large you could > instead use a "Claim Check" EIP pattern. That means you pass around a > reference to a data store external to the route (database, ehcache, > whatever) and then access the data in a route using a claim check. So if > you had a route that stuffed the message in a cache, sent around the check, > then another node could fetch the data out of the cache. > > Look at the ehcache and claim check patterns. > > *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* > *Author of: Hardcore Java (2003) and Maintainable Java (2012)* > *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 > <http://www.linkedin.com/pub/robert-simmons/40/852/a39>* > > > On Wed, Apr 30, 2014 at 5:13 AM, Muhammad Ichsan wrote: > > > OK. I really get your point. Great answer! > > > > Thanks > > > > On Wed, Apr 30, 2014 at 5:18 PM, Jens Breitenstein > > > wrote: > > > onder if performance is really a problem? An object makes handling of > > your > > > business logic in all your camel processors far easier (a map, a > business > > > related class) in contrast to repeatingly parse XML again and again (in > > case > > > your logic is spread accross multiple processors). If you create an > > instance > > > ones and just send it immediately by JMS simply go for java's default > > > serialization and you are done without writing any additional code > until > > > performance really matters > > > > > > > > > > -- > > ~The best men are men who benefit to others > > http://www.michsan.web.id 一緒に勉強しましょう! > > > > Yang berkualitas memang beda rasanya! > > http://rizqi-cookies.com > > >
Re: Fastest Data Holder
OK. I really get your point. Great answer! Thanks On Wed, Apr 30, 2014 at 5:18 PM, Jens Breitenstein wrote: > onder if performance is really a problem? An object makes handling of your > business logic in all your camel processors far easier (a map, a business > related class) in contrast to repeatingly parse XML again and again (in case > your logic is spread accross multiple processors). If you create an instance > ones and just send it immediately by JMS simply go for java's default > serialization and you are done without writing any additional code until > performance really matters -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Fastest Data Holder
Ah..! So, in the same JVM, using Java object simply uses an instance pointer. But if I'm going to produce into an ActiveMQ endpoint, I should make sure the MQ in the same JVM with vm transport or, I should marshall into protobuf bytes. The MQ is used for my own system too, but different physical location. On Wed, Apr 30, 2014 at 3:49 PM, mailingl...@j-b-s.de wrote: > What do you mean by different systems? Different Camel Processors? > > You can store your data as body/property and this is a pure instance pointer. > As long the message is not deep cloned/serialized as bytestream there is no > overhead passing this message through the camel routes (in one vm). > > Can you provide more info maybe I simply did not get it? > > Jens > > Von meinem iPhone gesendet > >> Am 30.04.2014 um 08:34 schrieb Muhammad Ichsan : >> >> Hi >> >> I'm thinking about creating a common message which will hold all data >> during all business invocations across different system in Camel (of >> course with translation for vary systems). >> >> In my first thought, I'm going to use a simple one like Map. The the >> payload is simple to use in processor. I can use >> >> public Map setFee(Map commonMessage) { >> // Modif >> >> return commonMessage; >> } >> >> But sending Map along the way of transaction process means that there >> will be conversion of java.util.Map into bytes over and over again. >> >> My second thought is, using XML or JSON text. But I face more complex >> processing in the processor >> >> public String setFee(String commonMessage) { >> Map map = helper.toMap(commonMessage); >> >> // Modif >> >> return helper.toString(map); >> } >> >> So, which one is the most efficient way? >> >> -- >> ~The best men are men who benefit to others >> http://www.michsan.web.id 一緒に勉強しましょう! >> >> Yang berkualitas memang beda rasanya! >> http://rizqi-cookies.com -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Fastest Data Holder
Hi I'm thinking about creating a common message which will hold all data during all business invocations across different system in Camel (of course with translation for vary systems). In my first thought, I'm going to use a simple one like Map. The the payload is simple to use in processor. I can use public Map setFee(Map commonMessage) { // Modif return commonMessage; } But sending Map along the way of transaction process means that there will be conversion of java.util.Map into bytes over and over again. My second thought is, using XML or JSON text. But I face more complex processing in the processor public String setFee(String commonMessage) { Map map = helper.toMap(commonMessage); // Modif return helper.toString(map); } So, which one is the most efficient way? -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: ActiveMQ consumer remains after shutdown
My question is: is it true that CachingConnectionFactory causes problem in Camel OSGi environment? On Jan 3, 2014 7:21 PM, "Claus Ibsen" wrote: > On Fri, Jan 3, 2014 at 1:18 PM, Muhammad Ichsan wrote: > > I'm using org.springframework.jms.connection.CachingConnectionFactory > > instead of org.apache.activemq.pool.PooledConnectionFactory. Is that > > problem? > > > > If you are using blueprint, then yeah you need to call its start|stop > method also - the method names may be destroy / init or whatever, so > you need to check that out. > > If you use spring xml file, then spring automatic should call its > start|stop methods. > But in blueprint this does not happen. > > > > While using org.apache.activemq.pool.PooledConnectionFactory with > > proper start and stop (init-method="start" destroy-method="stop"), I > > have no problem. > > > > On Fri, Jan 3, 2014 at 6:32 PM, Claus Ibsen > wrote: > >> If you use a connection pool then make sure that this pool is also > >> shutdown when you stop the bundle. > >> > >> eg usually that is to ensure the pool start|stop methods is invoked. > >> > >> See details at: > >> http://camel.apache.org/activemq > >> > >> On Fri, Jan 3, 2014 at 12:07 PM, Muhammad Ichsan > wrote: > >>> I have routes defined in an OSGi bundle. The routes use activemq > >>> component to process data. To be exact, I have camel listen into 3 > >>> different queue with concurrency = 10. > >>> > >>> As I started it in servicemix (apache-servicemix-4.4.0-fuse-00-27), I > >>> see in the Active MQ Web console that the queues are consumed as > >>> expected: > >>> - queue.a = 10 concurrent consumers > >>> - queue.b = 10 concurrent consumers > >>> - queue.c = 10 concurrent consumers > >>> > >>> Without doing any transaction, I stop the bundle. But strangely I have > >>> the following fact: > >>> - queue.a = 10 concurrent consumers > >>> - queue.b = 9 concurrent consumers > >>> - queue.c = 1 concurrent consumers > >>> > >>> where I expect all of them to be 0 concurrent consumers. > >>> > >>> This is a big problem, since when I start the bundle back, it creates > >>> more than 10 concurrent consumers for each queue. And my transaction > >>> can not run properly, because the old consumers (which remains), > >>> interfere the transaction messages. > >>> > >>> My question is, what's wrong here? Is a bug? Or I should do something > >>> to make it as expected? > >>> > >>> FYI, this is my ActiveMQ log level = INFO on Servicemix: > >>> http://pastebin.com/AcgQApDK > >>> > >>> Thanks > >>> > >>> -- > >>> ~The best men are men who benefit to others > >>> http://www.michsan.web.id 一緒に勉強しましょう! > >>> > >>> Yang berkualitas memang beda rasanya! > >>> http://rizqi-cookies.com > >> > >> > >> > >> -- > >> Claus Ibsen > >> - > >> Red Hat, Inc. > >> Email: cib...@redhat.com > >> Twitter: davsclaus > >> Blog: http://davsclaus.com > >> Author of Camel in Action: http://www.manning.com/ibsen > >> Make your Camel applications look hawt, try: http://hawt.io > > > > > > > > -- > > ~The best men are men who benefit to others > > http://www.michsan.web.id 一緒に勉強しましょう! > > > > Yang berkualitas memang beda rasanya! > > http://rizqi-cookies.com > > > > -- > Claus Ibsen > - > Red Hat, Inc. > Email: cib...@redhat.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > Make your Camel applications look hawt, try: http://hawt.io >
Re: ActiveMQ consumer remains after shutdown
I'm using org.springframework.jms.connection.CachingConnectionFactory instead of org.apache.activemq.pool.PooledConnectionFactory. Is that problem? While using org.apache.activemq.pool.PooledConnectionFactory with proper start and stop (init-method="start" destroy-method="stop"), I have no problem. On Fri, Jan 3, 2014 at 6:32 PM, Claus Ibsen wrote: > If you use a connection pool then make sure that this pool is also > shutdown when you stop the bundle. > > eg usually that is to ensure the pool start|stop methods is invoked. > > See details at: > http://camel.apache.org/activemq > > On Fri, Jan 3, 2014 at 12:07 PM, Muhammad Ichsan wrote: >> I have routes defined in an OSGi bundle. The routes use activemq >> component to process data. To be exact, I have camel listen into 3 >> different queue with concurrency = 10. >> >> As I started it in servicemix (apache-servicemix-4.4.0-fuse-00-27), I >> see in the Active MQ Web console that the queues are consumed as >> expected: >> - queue.a = 10 concurrent consumers >> - queue.b = 10 concurrent consumers >> - queue.c = 10 concurrent consumers >> >> Without doing any transaction, I stop the bundle. But strangely I have >> the following fact: >> - queue.a = 10 concurrent consumers >> - queue.b = 9 concurrent consumers >> - queue.c = 1 concurrent consumers >> >> where I expect all of them to be 0 concurrent consumers. >> >> This is a big problem, since when I start the bundle back, it creates >> more than 10 concurrent consumers for each queue. And my transaction >> can not run properly, because the old consumers (which remains), >> interfere the transaction messages. >> >> My question is, what's wrong here? Is a bug? Or I should do something >> to make it as expected? >> >> FYI, this is my ActiveMQ log level = INFO on Servicemix: >> http://pastebin.com/AcgQApDK >> >> Thanks >> >> -- >> ~The best men are men who benefit to others >> http://www.michsan.web.id 一緒に勉強しましょう! >> >> Yang berkualitas memang beda rasanya! >> http://rizqi-cookies.com > > > > -- > Claus Ibsen > - > Red Hat, Inc. > Email: cib...@redhat.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > Make your Camel applications look hawt, try: http://hawt.io -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
ActiveMQ consumer remains after shutdown
I have routes defined in an OSGi bundle. The routes use activemq component to process data. To be exact, I have camel listen into 3 different queue with concurrency = 10. As I started it in servicemix (apache-servicemix-4.4.0-fuse-00-27), I see in the Active MQ Web console that the queues are consumed as expected: - queue.a = 10 concurrent consumers - queue.b = 10 concurrent consumers - queue.c = 10 concurrent consumers Without doing any transaction, I stop the bundle. But strangely I have the following fact: - queue.a = 10 concurrent consumers - queue.b = 9 concurrent consumers - queue.c = 1 concurrent consumers where I expect all of them to be 0 concurrent consumers. This is a big problem, since when I start the bundle back, it creates more than 10 concurrent consumers for each queue. And my transaction can not run properly, because the old consumers (which remains), interfere the transaction messages. My question is, what's wrong here? Is a bug? Or I should do something to make it as expected? FYI, this is my ActiveMQ log level = INFO on Servicemix: http://pastebin.com/AcgQApDK Thanks -- ~The best men are men who benefit to others http://www.michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Preserving Exchange Header
I want to preserve headers of Exchange when sending to other queue. Is it possible? public void receiveAndForward(Exchange x) { timer.schedule(new TimerTask() { sendTo(x, "otherQ"); }, 3000); } So that I can read headers of x in the following route < read x header /> -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Configuring multicasts broker
I set up many ActiveMQ brokers using this: How to configure Camel to connect to the cluster? Because ports the brokers listen to is vary (not fixed). I'm new to clustering. Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Why this happened?
Hi I'm using Camel in FUSE 4.3.1 and I have implemented the converter. But the problem intermitent. I got this: javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException id.web.michsan.InternalMsg. Strangely that message is received via HTTP activemq-web-console in ActiveMQ.DLQ queue but not in SMX/data/log/servicemix.log. As if, this is not a big deal. This has caused my ActiveMQ.DLQ getting bigger. What happened? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Exception during testing
Hi Does anyone know why this happens? org.apache.camel.RuntimeCamelException: java.lang.IllegalAccessException: Class org.apache.camel.component.bean.MethodInfo can not access a member of class id.web.michsan.xt.route.CommonEndpointRouteBuilder$1 with modifiers "public" Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Another problem?
On Thu, May 5, 2011 at 1:14 PM, Muhammad Ichsan wrote: > Using above DSL, it did work. But it does not for the following XML: > > > > > > > > > > > > > > Did I miss something? > > Another question is: How to apply this globally instead of applying > this every time I see inOut pattern? > > Thanks Owh, I see that this works :D -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Another problem?
On Wed, May 4, 2011 at 8:47 PM, Muhammad Ichsan wrote: > On Wed, May 4, 2011 at 7:26 PM, Claus Ibsen wrote: >> Read the documentation > from(xxx) > .inOut().to("activemq:queue:foo") > .threads(5) > .to(yyy) > .to(zzz); > from("direct:casemx") .setExchangePattern(ExchangePattern.InOut) .to("activemq:preparation") .threads(10) .to("bean:mocky?method=delay2000") .to("mock:result"); Using above DSL, it did work. But it does not for the following XML: Did I miss something? Another question is: How to apply this globally instead of applying this every time I see inOut pattern? Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Another problem?
On Wed, May 4, 2011 at 7:26 PM, Claus Ibsen wrote: > Read the documentation > > See request/reply over JMS > http://camel.apache.org/jms Thank you so much Claus! This is what I've been looking for. from(xxx) .inOut().to("activemq:queue:foo") .threads(5) .to(yyy) .to(zzz); I'll try this -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Another problem?
On Wed, May 4, 2011 at 6:27 PM, Muhammad Ichsan wrote: > 2011/5/4 Claus Ibsen : >> Hi >> It's still in sequence manner, even for this code: ExecutorService executor = Executors.newFixedThreadPool(10); // When: 18 messages are sent for (int i = 0; i < messageAmount; i++) { executor.execute(new Runnable() { @Override public void run() { template.asyncSendBody("direct:casemx", "Hello" + next()); } }); } So, what your suggestion? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Another problem?
2011/5/4 Claus Ibsen : > Hi > > Its a bit hard to follow your question? > > Concurrency all starts with consumers. So if you have a single thread > that sends a message to "direct:casemx" then there is only a single > thread processing in that given route. This is how I send the message: for (int i = 0; i < messageAmount; i++) { template.asyncSendBody("direct:casemx", "Hello" + i); } My question is, why 5 invocations of delay1000 takes only (more or less) 1 seconds, meanwhile delay2000 takes 10 seconds (5 * 2000ms)? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Another problem?
Dear All I found another problem in Camel. Given context file (the java bean code is self-explainable): With activemq concurrency 10. If I send 8 message at once into direct:casemx, delay1000 method will be called concurrently. But... delay2000 is not!!! Do I miss something here? Or this is just another bug??? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: InOut in routingSlip
2011/5/4 Claus Ibsen : > Hi > > I created an unit test based on our routes and it works fine > http://svn.apache.org/viewvc?rev=1099342&view=rev So, why it's not working with Spring? Is it Camel's bug related to Spring? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Load testing
On Wed, May 4, 2011 at 11:27 AM, boday wrote: > here are a few links that might help... > Thanks! But, how about time limitation? I need to make sure that when sending 100 messages in concurrency 20 into a 5s processor, camel can process 20 messages in 5s. -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Load testing
Dear All I want to load testing my camel so that I know if my configuration - e.g. concurrentConsumers=10 - can process a 10 messages at one time concurrently. How to do this? Is there any real example? Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: InOut in routingSlip
On Tue, May 3, 2011 at 10:00 PM, Claus Straube wrote: > ok - I see the problem. Try this instead: > > public void configure() throws Exception { > > from("direct:foo") > .inOut("activemq:queue:a", "activemq:queue:b") As far as I know, queue will be used by default. I did try your suggestion, but it's still happening: Failed. -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: InOut in routingSlip
On Tue, May 3, 2011 at 6:55 PM, Claus Straube wrote: The problem is not when using "direct", but when using "activemq" I'm using: 2.6.0 3.0.5.RELEASE 5.4.2 It's still happening in 2.7.1 If you need my code to review, this is the complete artifact http://michsan.web.id/system/files/routing-learn.tgz Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: InOut in routingSlip
On Tue, May 3, 2011 at 3:49 PM, Claus Straube wrote: > Hi Muhammad, Ichsan please :D > > I think the error must be in your iMessageUtil class. This route works as > you would expect: IMHO, I think it's a bug in Camel. Please look at my testing artifacts: Java code: import org.apache.camel.EndpointInject; import org.apache.camel.Produce; import org.apache.camel.ProducerTemplate; import org.apache.camel.component.mock.MockEndpoint; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({"/TestRoutingSlipWithJustBean.xml"}) public class TestRoutingSlipWithJustBean { @EndpointInject(uri = "mock:result") protected MockEndpoint resultEndpoint; @Produce(uri = "direct:foo") protected ProducerTemplate template; @DirtiesContext @Test public void testRoutingSlip() throws Exception { // Expected: headers contain them resultEndpoint.expectedHeaderReceived("a", "_a"); resultEndpoint.expectedHeaderReceived("b", "_b"); // When: a message is sent template.sendBody("Hello"); // Then: we meet the expectation resultEndpoint.assertIsSatisfied(); } } while iMessageUtil methods are: public void invokeA(Exchange x) { x.getIn().setHeader("a", "_a"); LOGGER.debug("invokeA is called"); } public void invokeB(Exchange x) { x.getIn().setHeader("b", "_b"); LOGGER.debug("invokeB is called"); } and my context file: == http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:p="http://www.springframework.org/schema/p"; xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd";> http://camel.apache.org/schema/spring";> activemq:a,activemq:b routing Thanks
InOut in routingSlip
Dear All, Is it possible to use inOut in routingSlip? In the following context, the destination is visited asynchronously instead of - my expectation - synchronously. Why this happens? http://camel.apache.org/schema/spring";> nextDestination Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Immutable object
On Thu, Oct 14, 2010 at 4:06 PM, Willem Jiang wrote: >> So, Camel will use the same instance across Camel routes? >> >> I failed to replace the message into getIn().setBody() with the >> message clone. It triggers time out exception. May be it's because I'm >> not quite understand about inOut trick. This situation forces me to >> have Camel call clone-service bean before getting into modification >> bean. And it works. >> > > Deep copying will introduce the performance issue to camel, you have to do > it yourself. Basically Camel will copy the message headers and message body > and exchange properties from first exchange to a new next exchange when it > passes the next exchange to another process. So, it's about performance issue. I see that... What a good explanation! Thanks! -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Immutable object
On Thu, Oct 14, 2010 at 3:23 PM, Willem Jiang wrote: > st create a new copy of internalMessage in the modify method and set it to > the message body after the modification ? So, Camel will use the same instance across Camel routes? I failed to replace the message into getIn().setBody() with the message clone. It triggers time out exception. May be it's because I'm not quite understand about inOut trick. This situation forces me to have Camel call clone-service bean before getting into modification bean. And it works. -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Immutable object
Dear Camel Experts I have an object which becomes the main message to be transported across camel routes. So, I don't use String or other simple object. That's why I have to use converter. @Converter public class InternalMessageConverter { @Converter public static InputStream toText(InternalMessage iMsg) { return new ByteArrayInputStream(iMsg.toString().getBytes()); } } The problem is at this route: ${in.header.nextDestination} != null When I send a message, the log.transaction will have the same messages which are both modified. I expect that I will have two different messages inside log.transaction (the unmodified and the modified one). Because the first wireTap sends the unmodified message to log but the second one sends the modified message. How to achieve this? Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Possibility of using inOut
2010/8/31 Claus Ibsen > Read chapter 7 in the Camel book how to do request/reply over JMS. > > The 2nd route (amq:input) will "detect" the JMSReplyTo header > automatic and automatic return back the reply. So you don't have to do > that manually. > Just at the end of the routing the message is send back to the > JMSReplyTo destination. > Sorry, I think you don't get it. The communicator is a socket bean which maintain connection to remote host. A message sent to it can be a request (which we can wait a response) and can be also a response. When a response is coming in from bean:communicator?method=readResponse, then I have to make the correlation id is the same with corresponding request and it is sent back to amq:output. Else (when a request coming from bean:communicator?method=readResponse), I just throw it to another queue and do not care about correlation id. The problem is I don't know exactly how to implement this communicator. This is my snippet: void justSendNoWait(Exchange x) { MyMessage m = x.getIn().getBody(MyMessage.class); if (m.isRequest()) { saveCorrelationId(m.getTraceNumber(), x.getIn().getHeader("JMSCorrelationID")); x.setPattern(ExchangePattern.InOnly); // I don't know if this is necessary to make the message not delivered to it's caller, but instead wait for future response } } void readResponse(Exchange x) { MyMessage m = x.getIn().getBody(MyMessage.class); if (m.isResponse()) { String cid = readCorrelationId(m.getTraceNumber()); x.getOut().setHeader("JMSCorrelationID", cid); x.getOut().setBody(x.getIn().getBody()); } } Is this correct? I have problem with this. Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Possibility of using inOut
Dear All I want to know if this is possible How to implement communicator then? Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Error using inOut pattern
On Tue, Aug 31, 2010 at 2:32 PM, Willem Jiang wrote: > Muhammad Ichsan wrote: > >> >> Thanks for your reply. Here I've just attached my complete code to make it >> easier to analyze. This is strange. >> >> I can't see any code from your mail. > Can you just past into the mail, I think the user mailing list doesn't > support the attachment. > I tought so. So, please look at this: http://filebin.ca/kvwcgp/research-inout.zip_ Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Error using inOut pattern
On Tue, Aug 31, 2010 at 2:07 PM, Willem Jiang wrote: > Hi, > > Can you just insert a processor after the "activemq:mm01.rin" endpoint? > Maybe something is wrong with your internalViewer bean. > Thanks for your reply. Here I've just attached my complete code to make it easier to analyze. This is strange. -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Error using inOut pattern
Dear All I have problem related to inOut in my attachment. The problem is that, Exchange.getIn().getBody() is null after inOut invocation. This problem doesn't occur if I do not have any after activemq:mm01.rin Thanks for your guidance. -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
InOut problem
I have the following routes: http://pastebin.ca/1929016 If the link is broken, see the following: The problem is, if I uncomment the XML comment 'Problem cause', the route will be error. Unpredicted behaviour occurs. Why this happens? This bean:interMessageController is a bean that put back jms correlation id in x.getOut(). I think the problem is that queue doesn't support inOut with replyTo where the inner process also contains inOut. Anyone can help me? Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Using blueprint
2010/7/16 Guillaume Nodet : > Have a look at http://camel.apache.org/using-osgi-blueprint-with-camel.html > Let me know if you need more informations. Actually, I've tried this. But, there was problem with Spring. Some kind of collision between 2.5.0SEC02 and 3.0.3RELEASE. It's really complicated. Apparently, FUSE uses blueprint from Geronimo project not from Aries. I tried to stop the Geronimo blueprint bundle, so that it will use Aries'. But the ESB container totally died. Sorry if this is not Camel related thing. If it is not, would you tell me where to ask this problem? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Testing using Pax Exam
On Wed, Jul 14, 2010 at 8:41 PM, Willem.Jiang wrote: > > Maybe you can consider to put the activemq-broker file into your unit test > test resource directory. No, it's not working. It still complains about missing [spring:file:etc/activemq-broker.xml]. If you want to see how I produce this error, you can see here: http://fusesource.com/forums/thread.jspa?messageID=7200ᰠ Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Using blueprint
Is Camel Blueprint ready for FUSE ESB 4.2.0 container? I want to deploy my Camel-enabled app in blueprint way inside the container. If it's not, I will use Spring way instead. If it is, how to make it work? What features or bundles should be inactive or uninstalled. Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Testing using Pax Exam
On Fri, Jul 9, 2010 at 7:48 PM, Willem Jiang wrote: > Hi, > > Can you try to put the file into the WorkingDirectory of your Pax Exam? > You can set this option from the static "configure" method. I did set working directory as http://fusesource.com/docs/esb/4.2/deploy_osgi/BestPractices-PaxExam.html told me so. workingDirectory("target/paxrunner/features/") I copied the etc/activemq-broker.xml so that I can see "target/paxrunner/features/etc/activemq-broker.xml" This is not working. I still get an error stating that "spring:file:etc/activemq-broker.xml" is not found -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Testing using Pax Exam
How to test my Camel application using Pax Exam? I need to test across bundles which requires Active MQ ("uri=activemq:blahblah") using OSGi. I tried to load the activemq-broker feature but failed. It needs /etc/active-broker.xml configuration. I don't know where to put the file and how. Sorry if you think this is OOT. Would you please suggest me where to ask this question. Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Preven leaks in Camel App during development phase
Hi All Does Anyone know how to prevent problem in your Camel application during development phase, like CPU eating and raising Java Heap Space that cause my Camel App dropped? I want to recreate my Camel App so that the problem vanished. I hate restarting my app daily. I really appreciate if you can tell me how to do that in Hudson. If this is really out of topic, would you suggest me mailing list where I can mail to? Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: InOut not working
2010/5/19 Claus Ibsen : > On Wed, May 19, 2010 at 6:43 AM, Muhammad Ichsan wrote: >> 2010/5/18 Claus Ibsen : >>> Try without ?replyTo=out >> > > Do something simpler and then add to the route. > For example using only JMS, mock etc. to have a simple test starting. > > And InOut over JMS works transparent, so you do not have to send to > the OUT queue or mess with correlation ids etc. 1. Don't mess with correlation id? Shouldn't we set the correlation id in order to make the inOut ends? 2. Where can I read more to understand InOut pattern. I want to know, when to use exchange.getOut() and when to use getIn() This is my actual problem 1. I need to send an X type message into a server 2. The server only accept Y type message and it will respond in Y type response message too. This way, I create: from("activemq:input").to("bean:converter?method=keepCorrelationIdAndTranslateToY").to("direct:serverInput"); from("direct:serverOutput").to("bean:converter?method=translateToXAndSetCorrelationId").to("activemq:out") from("direct:process").to("activemq:input?replyTo=out").to("file://tmp/result.txt") Thanks -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: InOut not working
2010/5/18 Claus Ibsen : > Try without ?replyTo=out Not working -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
InOut not working
Dear All I have the following routes: // To test in out pattern from("direct:input").setExchangePattern(ExchangePattern.InOut).to("activemq:in?replyTo=out").to("mock:result"); from("activemq:in").to("bean:con?method=toExternalMessageRequest").to("bean:biller?method=write"); from("bean:biller?method=read").to("bean:con?method=toInternalMessageResponse").to("activemq:out"); Inside toInternalMessageResponse() I've set the JMSCorrelationId based on JMSMessageId retrieved in toExternalMessageRequest(). But why the in out is not working. I got this: May 18, 2010 8:15:12 PM org.apache.camel.component.mock.MockEndpoint assertIsSatisfied INFO: Asserting: Endpoint[mock://result] is satisfied May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultCamelContext doStop INFO: Apache Camel 2.2.0 (CamelContext:camel-1) is stopping May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy shutdown INFO: Starting to graceful shutdown routes (timeout 10 seconds) May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Route: route1 shutdown complete. May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Route: route2 shutdown complete. May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Route: route3 shutdown complete. May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Route: route4 suspended and shutdown deferred. May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Route: route5 suspended and shutdown deferred. May 18, 2010 8:15:12 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Waiting as there are still 1 inflight and pending exchanges to complete before we can shutdown May 18, 2010 8:15:13 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Waiting as there are still 1 inflight and pending exchanges to complete before we can shutdown May 18, 2010 8:15:14 PM org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask run INFO: Waiting as there are still 1 inflight and pending exchanges to complete before we can shutdown -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: How to convert
On Tue, May 18, 2010 at 6:51 PM, Muhammad Ichsan wrote: > Dear All > > I have the following routes: > > from("direct:input").to("activemq:in?replyTo=out").to("mock:result"); > Sorry. My mistake. I should use public class for both message classes. -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
How to convert
Dear All I have the following routes: from("direct:input").to("activemq:in?replyTo=out").to("mock:result"); // This receive InternalMessage object and send to a biller (the biller bean receive ExternalMessage object) from("activemq:in").to("bean:con?method=toExternalMessageRequest").to("bean:biller?method=write"); from("bean:biller?method=read").to("bean:con?method=toInternalMessageResponse").to("activemq:out"); I sent InternalMessage object into direct:input but I got java.io.NotSerializableException. I did set InternalMessage and ExternalMessage as Serializable. What's going on? -- ~The best men are men who benefit to others http://michsan.web.id 一緒に勉強しましょう! Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: How to test
On Thu, Apr 22, 2010 at 8:24 PM, Claus Ibsen wrote: > Hi > > I dont tink the tar have the -test source code. > > You can view that online at > > https://svn.apache.org/repos/asf/camel/trunk/components/camel-mina/src/test/ > Thanks, this URL is enough for me. But the test class needs some modification to suit latest Camel and JUnit 4 -- ~The best men are men who benefit to others http://michsan.web.id
How to test
Dear All I want to create a component which also use its own uri. How to unit test the component? I see nothing about testing components (e.g. camel-mina) in the source apache-camel-2.2.0-src.tar.gz -- ~The best men are men who benefit to others http://michsan.web.id
Re: Mina endpoint behaviour
On Fri, Apr 2, 2010 at 2:47 AM, Ashwin Karpe wrote: > > Hi, > > Yes, they will connect to each other since the URL points to the same host > and port over TCP. There is no point doing this. There is a never ending loop when doing this. I've tried myself. -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Mina endpoint behaviour
On Thu, Apr 1, 2010 at 7:13 PM, Ashwin Karpe wrote: > > Hi, > > You cannot do it the way you have detailed. The endpoint in the from() > clause will create a TCP Listener and bind to a socket (aka server). > > You could do the following and accomplish your objective > > In Client > -- > from (...) > .to(mina:tcp://localhost:5000?sync=true") // Client > .to("bean:processResponse"); > > In Server > -- > from(mina:tcp://localhost:5000?sync=true") // Server > .to("bean:processData"); I think the routes above will connect each other, won't they? The first to(mina) will connect to from(mina) -- ~The best men are men who benefit to others http://michsan.web.id
Mina endpoint behaviour
Dear All, I tried to use mina endpoints. I see that mina endpoints which is used in will act as servers and the ones which is used in will act as clients. Actually, I need mina endpoints which more or less defined as the following code: Is it possible? Thanks! -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Possible cause of slow
Dear All I have strange problem in Camel. I use routingSlip like the following: ... ... There was no problem before in flowing in a 4-endpoint routing slip. But now, the third of the endpoints is visited 30s-38s since last endpoint is visited. What are the possible causes? This are the details: header InvokerEndpointList: q1, q2, q3, q4 This is the way I log my time for all queues above. ... The fact is q3timeGetIn - q2timeGetOut >= 30s Why this happens? Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
How to propagate exception?
Hi All Based on the following routes: Is it possible to use the tag there? Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Can loop work together with onException?
Dear all I have a route which is called by like the following: my.Exception true 5000 ${in.header.repeat} != null The problem is, once a MyException arise, the loop stop completely. How this happened? Regards -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Re: Why I got exception?
On Thu, Feb 11, 2010 at 1:14 AM, Muhammad Ichsan wrote: > Dear All, > > Please see http://pastebin.com/m4c32d43e Revised: http://pastebin.com/m456bef74 -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Why I got exception?
Dear All, Please see http://pastebin.com/m4c32d43e The problem is, why I always get timeout. I always get "OMG! Timeout in inOut poc.itm.invoker.in". I see nothing's wrong here. Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
How to use threads
Dear All I've been searching about how to use threads in Camel. But I found nothing which answer my problem. This is one of my routes: . As I put there I got this warning: [aultMessageListenerContainer-1] JmsBinding WARN Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: java.util.concurrent.ScheduledThreadPoolExecutor.ScheduledFutureTask. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint. And my code doesn't work anymore. How to use threads then? I want to make more messages processed more in limited time. Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
How to specifiy increase concurrent consumers inOut
Dear All I have to questions: 1. How to specify concurrent consumers for queue:oth in Because, "concurrentConsumers=50" only applies to queue:inh (as I see in activemq webadmin console which states only one consumer listening to queue:oth) I'm considering this is one of the culprits of my slow app. 2. It seems that camel doesn't see a message with the same correlation id as a response message in (IMHO). I have an application which listens to activemq:inh (see tag in my first question) and put a response (new message with the same correlation id) into activemq:oth in a hope that 's blocking will end. Although the blocking end, I still receive Time out exception. Why this happens? Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
Maximize TPS
Dear All I'm using Camel, ActiveMQ and ServiceMix Is it possible to achieve average 100 transaction per second (stable response time, not rising one). What are things to consider? I've add concurrentConsumers=100 but the response time is still rising. I'm glad if you could give me any links for reference. Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com
What best way for correlated message?
Dear All, I have a class which send a request message and also read a response message through socket. I want to add it into my camel. What's the best option? I'm considering implement this (to be invoked through bean): /** @return String The response */ public String executeMessage(String request); This is a blocking method which send a request and set correlation key into it and associate the request message later with the response message using the same correlation key. Or... do you have any better options? Like asynchronous call and receive? Thanks -- ~The best men are men who benefit to others http://michsan.web.id Yang berkualitas memang beda rasanya! http://rizqi-cookies.com