Re: Best way to throw away an exchange in a route in an otherwise() case

2009-10-16 Thread Claus Ibsen
On Sat, Oct 17, 2009 at 2:02 AM, jonathanq  wrote:
>
> I think I found the solution in the documentation (that's what I get for
> finally posting a question - never fails I will find the answer 10 minutes
> later).
>
> This is waht I have now:
>
> from("direct:incoming")
>            .choice()
>              .when(header("status").isEqualTo("1"))
>                .process(status1processor)
>              .when(header("status").isEqualTo("2))
>                .process(status2processor)
>              .otherwise().process(unknownstatusprocessor).stop()
>            .end()
>            .process(someOtherProcessor)
>            .to("mock:outgoing);
>
> Specifically - I added the .stop() to the otherwise() path.
>
> .otherwise().process(getUnknownEmailStatusProcessor()).stop()
>
> Is that the correct way to do it?  My unit tests seem to say so..but I
> wanted to ask the experts to be sure.

Yeah stop() is the right way to do so. Its also easy to understand
what it does :)

The message filter is another way (a more classic EIP solution)
http://camel.apache.org/message-filter.html


> --
> View this message in context: 
> http://www.nabble.com/Best-way-to-throw-away-an-exchange-in-a-route-in-an-otherwise%28%29-case-tp25933807p25933965.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Using HTTPS in camel-http when remote side has self-signed cert

2009-10-16 Thread Willem Jiang

Hi,

You can do some customer modification on the HttpClient through the 
CamelHttpClientConfigurer interface.


public class AcceptSelfSignCertHttpClientConfigure implements 
HttpClientConfigurer {


public void configureHttpClient(HttpClient client) {
// register the customer SSLFactory
ProtocolSocketFactory easy = new EasySSLProtocolSocketFactory();
Protocol protocol = new Protocol("https", easy, 8443);
Protocol.registerProtocol("https", protocol);

}
}

And configure the configure through the HTTP endpoint URI.

If you has another http client configuration , you can use the 
CompositeHttpConfigurer[1] to hold these configuration.


[1] 
https://svn.apache.org/repos/asf/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CompositeHttpConfigurer.java


Willem


Scott Parkerson wrote:

I'm trying to use Camel's HTTP component to send a POST request to a
web service using HTTPS. When I attempt to connect, I get the
following exception:

org.apache.camel.RuntimeCamelException:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:850)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:138)
at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:101)
at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:105)
at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:121)
at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:201)
[etc.]

I'm pretty sure that this is because the remote side is using a
self-signed certificate.

The question is: is there a good way to replace the behavior SSL
factory used by the Commons HTTPClient inside of the camel-http
component to make it accept self-signed certificates? I see that the
docs mention that you can provide a class that extends
CamelHttpClientConfigurer and configure the endpoint to use a
reference to that bean.

Ideas?

--sgp
cf. http://www.smerpology.org/





Re: JmsComponent uses spring's deprecated class

2009-10-16 Thread Willem Jiang

You can count on Camel in Action which is working in progress :)

linuca wrote:

Thanks Fintan! At first glance, this documentation looks really good!

I bought ActiveMQ in Action, and I think it is great, the examples are good.
But when I tried to use Camel... that is where I see the lack of
documentation. What I expect in a manual is, not only the description of the
API and the things you can do, but also working examples (explained for
dummies). It looks that they put the minimum information for every
functionality, with complex and uncomplete examples. And you get this
undesirable begginer's frustruation...

Anyway, I won't give up and keep on trying. Right now I'm trying to perform
a select query on the database, and then send the result to a consumer to
insert the records (with iBatis). Once I get a working example, I'll post it
here with the full code!

Cheers and thanks again,

Linuca.






Re: Best way to throw away an exchange in a route in an otherwise() case

2009-10-16 Thread jonathanq

I think I found the solution in the documentation (that's what I get for
finally posting a question - never fails I will find the answer 10 minutes
later).

This is waht I have now:

from("direct:incoming")
.choice()
  .when(header("status").isEqualTo("1"))
.process(status1processor)
  .when(header("status").isEqualTo("2))
.process(status2processor)
  .otherwise().process(unknownstatusprocessor).stop()
.end()
.process(someOtherProcessor)
.to("mock:outgoing);

Specifically - I added the .stop() to the otherwise() path. 

.otherwise().process(getUnknownEmailStatusProcessor()).stop()

Is that the correct way to do it?  My unit tests seem to say so..but I
wanted to ask the experts to be sure.
-- 
View this message in context: 
http://www.nabble.com/Best-way-to-throw-away-an-exchange-in-a-route-in-an-otherwise%28%29-case-tp25933807p25933965.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Best way to throw away an exchange in a route in an otherwise() case

2009-10-16 Thread jonathanq

I apologize if this is a simple question - but I just need to be sure!

I am developing this route that handles multiple message types and uses a
"when()" predicate to send the message to the appropriate processor based on
a header value.  In the "Otherwise" case I want to send it to an unknown
format processor to log the error but I don't want the exchange to continue
from there (as there is further processing that needs to only occur on a
valid message).

Here is the route:

from("direct:incoming")
.choice()
  .when(header("status").isEqualTo("1"))
.process(status1processor)
  .when(header("status").isEqualTo("2))
.process(status2processor)
  .otherwise().process(unknownstatusprocessor)
.end()
.process(someOtherProcessor)
.to("mock:outgoing);

Now - I thought of just putting:

.otherwise().process(unknownstatusprocessor).to("mock:garbage")

The main concern I have is that I want this "garbage" endpoint to be
something we can use in our live environment.  I am not sure if "mock" is
wise.  I thought of "direct:garbage" - but as I understand it - that is an
"in memory queue" essentially.  And I don't want it to ever fill up if
exchanges just sit there unprocessed.

I just want to make sure that whatever endpoint I use - it truly is a
"garbage can".  We just want to log the information and get rid of the
message.  Am I over thinking the behavior of "mock" and it will just be the
black hole I am looking for?

Thanks for the help!
-- 
View this message in context: 
http://www.nabble.com/Best-way-to-throw-away-an-exchange-in-a-route-in-an-otherwise%28%29-case-tp25933807p25933807.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Looking for advice on design issues...

2009-10-16 Thread Barry Kaplan

I'm trying to reason out an application design.

I have a "service" that I want to make available to "clients" via various
protocols (http, jms, mina, etc). I will need some adapter layers on the
"service" side to, eg, populate the http response code.

I would like remote clients to access to access the service via URIs of the
form:
 - "mtcagent:http://host:port";
 - "mtcagent:jms://host:port"
 - "mtcagent:mina://host:port"

I'm thinking I would like to configure the service/server routes like (sorry
for scala, its all I've used so far):

new RouteBuilder {
  "mtcagent:http://host:port"; to process( (exchange: Exchange) => {
val message =
messageFromUriPath(exchange.in(Exchange.HTTP_PATH).asInstanceOf[String])
to ("direct:agent")
  "mtcagent:jms://host:port" to process( (exchange: Exchange) => {
val message = messageFromJms(exchange.in)
to ("direct:agent")
  ...
  })

I'm not quite sure how "direct:agent" gets routed to my pojo (which I may
want to be accessed via actors).

I started looking at implementing Component and Endpoint. But what's got a
me a bit confused is that my "component" is not of the same kind as existing
components: Its not a transport but rather a service. So I'm not sure if I'm
on the right track. 

Any advice would be appreciated. Or any references to an impl of this form.

thanks!
-barry
-- 
View this message in context: 
http://www.nabble.com/Looking-for-advice-on-design-issues...-tp25930468p25930468.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to save a select result from camel-sql componnent to xml ( No type converter available to convert from type: java.util.ArrayList issue )

2009-10-16 Thread Claus Ibsen
On Fri, Oct 16, 2009 at 5:24 PM, llecaroz  wrote:
>
> Hello,
> I am really impresed by the capabilities of Apache Camel.
> I am creating a workflow with a similar route
>                        
> 1
>                                
>                                
>                                        
> out.txt
>                                
>                        
>
> It works great until trying to save select result :(
>
> because it is an arralist returned, it appears that Apache Camel does not
> have any convert type :(
> I tried also to use jaxb mashall or convertBodyto to convert it before into
> a xml format, but without any success, so I don't know what to do with the
> result without writing a pojo consumer !?
>
> I spent multiple hours on Internet to search for tutorials or other apache
> camel users encountering the same need behavior but no answer :(
>

You can use Java code to transform the payload into a more appropriate format.

You can use a org.apache.camel.Processor or POJO






public class MyTransformProcessor implements Processor {
 ...
  List data = exchange.getIn().getBody(List.class);
   // use regular java code to transform to a better form
   exchange.getIn().setBody(betterBody);
}



See more at the Message Translator EIP
http://camel.apache.org/message-translator.html

The SQL component returns raw data in a List that is like the sql ResultSet.
You gotta transform that manually to something else using Java code.

Or use some ORM that can map from the database to POJO classes which
are easier to marshal to XML using camel-xstream or JAXB annotations
etc.



>
> Expert help on my question would be appreciate ;)
> Really thx in advance
> Regards
> Louis
>
>
> Caused by: org.apache.camel.InvalidPayloadException: No body available of
> type: java.io.InputStream but has value: [{ruleId=1, syncDir=/essai/1}] of
> type: java.util.ArrayList on: Message: [{ruleId=1, syncDir=/essai/1}].
> Caused by: No type converter available to convert from type:
> java.util.ArrayList to the required type: java.io.InputStream with value
> [{ruleId=1, syncDir=/essai/1}] on the exchange: Exchange[Message:
> [{ruleId=1, syncDir=/essai/1}]]
>
> --
> View this message in context: 
> http://www.nabble.com/How-to-save-a-select-result-from-camel-sql-componnent-to-xml-%28-No-type-converter-available-to-convert-from-type%3A-java.util.ArrayList-issue-%29-tp25927249p25927249.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


How to save a select result from camel-sql componnent to xml ( No type converter available to convert from type: java.util.ArrayList issue )

2009-10-16 Thread llecaroz

Hello, 
I am really impresed by the capabilities of Apache Camel.
I am creating a workflow with a similar route

1


out.txt
  


It works great until trying to save select result :(

because it is an arralist returned, it appears that Apache Camel does not
have any convert type :(
I tried also to use jaxb mashall or convertBodyto to convert it before into
a xml format, but without any success, so I don't know what to do with the
result without writing a pojo consumer !?

I spent multiple hours on Internet to search for tutorials or other apache
camel users encountering the same need behavior but no answer :( 


Expert help on my question would be appreciate ;)
Really thx in advance
Regards
Louis


Caused by: org.apache.camel.InvalidPayloadException: No body available of
type: java.io.InputStream but has value: [{ruleId=1, syncDir=/essai/1}] of
type: java.util.ArrayList on: Message: [{ruleId=1, syncDir=/essai/1}].
Caused by: No type converter available to convert from type:
java.util.ArrayList to the required type: java.io.InputStream with value
[{ruleId=1, syncDir=/essai/1}] on the exchange: Exchange[Message:
[{ruleId=1, syncDir=/essai/1}]]

-- 
View this message in context: 
http://www.nabble.com/How-to-save-a-select-result-from-camel-sql-componnent-to-xml-%28-No-type-converter-available-to-convert-from-type%3A-java.util.ArrayList-issue-%29-tp25927249p25927249.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: handling large files

2009-10-16 Thread Claus Ibsen
Hi

Try searching with google and ask on the AMQ forum.

Are you AMQ queue big enough to contain all this data? Do you have
consumers reading off the queues?
And AMQ have many parameters to configure it correctly.

Remember to report which AMQ version you are using.

And how big is the messages you send? Are they text based on binary based.

On Fri, Oct 16, 2009 at 2:41 PM, mcarson  wrote:
>
> Using the scanner seems to work for parsing down the huge file based upon a
> delimiter.  However it appears that either the JmsTemplate I'm using to send
> messages or ActiveMQ cannot keep pace.
>
> Somewhere between 250K - 500K sends, I get this stack trace:
>
> Exception in thread "main"
> org.springframework.jms.UncategorizedJmsException: Uncategorized exception
> occured during JMS processing; nested exception is javax.jms.JMSException:
> java.io.EOFException
>        at
> org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:308)
>        at
> org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
>        at 
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
>        at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:548)
>        at asa.camel.TestScanner.parseRecord(TestScanner.java:62)
>        at asa.camel.TestScanner.readFile(TestScanner.java:34)
>        at asa.camel.TestScanner.main(TestScanner.java:82)
> Caused by: javax.jms.JMSException: java.io.EOFException
>        at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
>        at
> org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1244)
>        at
> org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1339)
>        at
> org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:298)
>        at
> org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:196)
>        at 
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:462)
>        ... 4 more
> Caused by: java.io.EOFException
>        at java.io.DataInputStream.readInt(DataInputStream.java:375)
>        at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:210)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:202)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
>        at java.lang.Thread.run(Thread.java:619)
>
> Any ideas what could cause this?
>
>
> Claus Ibsen-2 wrote:
>>
>>>
>>>
>>> Claus Ibsen-2 wrote:

 Hi

 How do you want to split the file?
 Is there a special character that denotes a new "record"

 Using java.util.Scanner is great as it can do streaming. And also
 what
 Camel can do if you for example want to split by new line etc.

 --
 Claus Ibsen
 Apache Camel Committer

 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/handling-large-files-tp25826380p25924781.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Camel on Google App Engine

2009-10-16 Thread Claus Ibsen
On Fri, Oct 16, 2009 at 4:56 PM, Martin Krasser  wrote:
>
> Their performance is almost the same. Generating 1 million UUIDs on my laptop
> takes about 3 seconds +/- 100ms. UUID tends to be a bit faster than Camel's
> UUIDGenerator.
>

Cool. I also guess SUN/Oracle can improve their UUID over time :)

I think you should create a JIRA and provide a patch.


>
> James.Strachan wrote:
>>
>> 2009/10/16 Guillaume Nodet :
>>> Isn't the activemq uuid generator a lot faster ?
>>
>> Dunno - have never benchmarked it.
>>
>> I guess we could either make it configurable; or default to UUID if we
>> can't create the default IdGenerator
>>
>> --
>> James
>> ---
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Camel-on-Google-App-Engine-tp25921155p25926771.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Camel on Google App Engine

2009-10-16 Thread Martin Krasser

Their performance is almost the same. Generating 1 million UUIDs on my laptop
takes about 3 seconds +/- 100ms. UUID tends to be a bit faster than Camel's
UUIDGenerator.


James.Strachan wrote:
> 
> 2009/10/16 Guillaume Nodet :
>> Isn't the activemq uuid generator a lot faster ?
> 
> Dunno - have never benchmarked it.
> 
> I guess we could either make it configurable; or default to UUID if we
> can't create the default IdGenerator
> 
> -- 
> James
> ---
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Camel-on-Google-App-Engine-tp25921155p25926771.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: camel-jetty to handle "prefix" uri?

2009-10-16 Thread Barry Kaplan

Works perfect. Thanks very much Claus!

-- 
View this message in context: 
http://www.nabble.com/camel-jetty-to-handle-%22prefix%22-uri--tp25919650p25926725.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: JmsComponent uses spring's deprecated class

2009-10-16 Thread linuca

Thanks Fintan! At first glance, this documentation looks really good!

I bought ActiveMQ in Action, and I think it is great, the examples are good.
But when I tried to use Camel... that is where I see the lack of
documentation. What I expect in a manual is, not only the description of the
API and the things you can do, but also working examples (explained for
dummies). It looks that they put the minimum information for every
functionality, with complex and uncomplete examples. And you get this
undesirable begginer's frustruation...

Anyway, I won't give up and keep on trying. Right now I'm trying to perform
a select query on the database, and then send the result to a consumer to
insert the records (with iBatis). Once I get a working example, I'll post it
here with the full code!

Cheers and thanks again,

Linuca.


-- 
View this message in context: 
http://www.nabble.com/JmsComponent-uses-spring%27s-deprecated-class-tp25897204p25926175.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.



Re: Feeding an Async Processor from an ActiveMQ topic

2009-10-16 Thread Claus Ibsen
On Fri, Oct 16, 2009 at 2:30 PM, Jörn Kottmann  wrote:
> Claus Ibsen wrote:
>>
>> On Thu, Oct 15, 2009 at 5:10 PM, Jörn Kottmann  wrote:
>>
>>>
>>> Claus Ibsen wrote:
>>>

 Hi

 You only have 1 consumer listening on the JMS topic
    

 Try increasing this number.


>>>
>>> JMS Topics can only have one concurrent consumer,
>>> so I guess I have to switch to a Queue, would it then
>>> run 100 threads for concurrentConsumers=100 ?
>>>
>>>
>>
>> Yeah then you got 100 threads concurrently.
>> Remember more is not always better.
>>
>
> Sure, so if i disable transactions could it then
> processes more messages parallel than
> the number of concurrent consumers ?
>

Not really as you got 100 concurrent consumers, with or without transactions.

Why dont you try it out and do some benchmark and see how it goes.
Do you actually have any SLA requirements you can use to hold up against?



> Jörn
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Problems while running route with the JBI Endpoint

2009-10-16 Thread Willem Jiang

Hi,

Did you deploy the servicemix-camel component into you ESB ?
Did the spring-dm bundles be resolved rightly ?

Willem

sailaja p wrote:

Hi All,

 I am trying to invoke a webservice using the JBI Endpoint. I got into
problems. I goggled the errors, but no luck.
 
 I have created a Bottom Up webservice and deployed it in FUSE ESB 4.2

server and published it. Service is deployed properly and I am able to view
the corresponding endpoints in the jconsole. Now I am trying to invoke this
endpoint using JBI Endpoint in my camel route. When I run the route, I got
the following exception.
 
 My route looks like this:
 
 		



http://sample.test/}HelloSampleService:HelloSamplePort";>


 
 Following is xbean.xml of the created Webservice
 
 http://sample.test/"; id="hellosample"

implementor="test.sample.HelloSample"
wsdlLocation="wsdl/hellosample.wsdl"
endpointName="tns:HelloSamplePort" 
serviceName="tns:HelloSampleService"
address="/HelloSamplePort">





 
 
 org.apache.camel.ResolveEndpointFailedException: Failed to resolve

endpoint:
jbi:endpoint:{http://sample.test/}HelloSampleService:HelloSamplePort due to:
org.apache.camel.RuntimeCamelException: Could not auto create component: jbi
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:357)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
at org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:99)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
at org.apache.camel.model.SendType.resolveEndpoint(SendType.java:57)
at org.apache.camel.model.SendType.createProcessor(SendType.java:51)
at
org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:2011)
at
org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:102)
at
org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
at
org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1895)
at 
org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:106)
at org.apache.camel.model.RouteType.addRoutes(RouteType.java:220)
at org.apache.camel.model.RouteType.addRoutes(RouteType.java:89)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:670)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:663)
at
org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:166)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:161)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:53)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:607)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:96)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
at
org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140)
at
org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:94)
at
com.fusesource.tools.eip.debug.launch.CamelStandinRuntime.doLaunchDebuggedContext(Unknown
Source)
at 
com.fusesource.tools.eip.debug.launch.CamelStandinRuntime.init(Unknown
Source)
at com.fusesource.tools.eip.debug.launch.CamelLauncher.main(Unknown
Source)
 Caused by: org.apache.camel.RuntimeCamelException: Could not auto create
component: jbi
at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:189)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:332)
... 32 more
 Caused by: java.lang.IllegalArgumentException: In

Re: handling large files

2009-10-16 Thread mcarson

Using the scanner seems to work for parsing down the huge file based upon a
delimiter.  However it appears that either the JmsTemplate I'm using to send
messages or ActiveMQ cannot keep pace.

Somewhere between 250K - 500K sends, I get this stack trace:

Exception in thread "main"
org.springframework.jms.UncategorizedJmsException: Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
java.io.EOFException
at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:308)
at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:548)
at asa.camel.TestScanner.parseRecord(TestScanner.java:62)
at asa.camel.TestScanner.readFile(TestScanner.java:34)
at asa.camel.TestScanner.main(TestScanner.java:82)
Caused by: javax.jms.JMSException: java.io.EOFException
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1244)
at
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1339)
at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:298)
at
org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:196)
at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:462)
... 4 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:375)
at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:210)
at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:202)
at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
at java.lang.Thread.run(Thread.java:619)

Any ideas what could cause this?


Claus Ibsen-2 wrote:
> 
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> How do you want to split the file?
>>> Is there a special character that denotes a new "record"
>>>
>>> Using java.util.Scanner is great as it can do streaming. And also
>>> what
>>> Camel can do if you for example want to split by new line etc.
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: 
http://www.nabble.com/handling-large-files-tp25826380p25924781.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel on Google App Engine

2009-10-16 Thread James Strachan
2009/10/16 Guillaume Nodet :
> Isn't the activemq uuid generator a lot faster ?

Dunno - have never benchmarked it.

I guess we could either make it configurable; or default to UUID if we
can't create the default IdGenerator

-- 
James
---
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/


Re: Feeding an Async Processor from an ActiveMQ topic

2009-10-16 Thread Jörn Kottmann

Claus Ibsen wrote:

On Thu, Oct 15, 2009 at 5:10 PM, Jörn Kottmann  wrote:
  

Claus Ibsen wrote:


Hi

You only have 1 consumer listening on the JMS topic


Try increasing this number.

  

JMS Topics can only have one concurrent consumer,
so I guess I have to switch to a Queue, would it then
run 100 threads for concurrentConsumers=100 ?




Yeah then you got 100 threads concurrently.
Remember more is not always better.
  

Sure, so if i disable transactions could it then
processes more messages parallel than
the number of concurrent consumers ?

Jörn



Re: Camel on Google App Engine

2009-10-16 Thread Guillaume Nodet
Isn't the activemq uuid generator a lot faster ?

On Fri, Oct 16, 2009 at 13:37, James Strachan  wrote:
> 2009/10/16 Martin Krasser :
>>
>> I'm trying to get camel-core running on Google App Engine. It doesn't run
>> out-of-the-box mainly because Camel's UUID generator. It uses InetAddress
>> that is not on the JRE class whitelist. Replacing the implementation using
>> Java's UUID class, I got a simple route running.
>>
>> Is there any special reason why Camel doesn't use Java's UUID class for
>> generating IDs? Do you see any issues replacing the current implementation?
>
> No, it should work with the UUID class AFAIK. Our own UUID generator
> is mostly a hang-over from JDK 1.4 and ActiveMQ - I don't see any
> issues yet with using java.util.UUID. If we hit any we could make it
> pluggable - but for simplicity maybe we should just switch?
>
>> I'll summarize other issues with Camel on GAE in a separate post.
>
> Great!
> --
> James
> ---
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>



-- 
Cheers,
Guillaume Nodet

Blog: http://gnodet.blogspot.com/

Open Source SOA
http://fusesource.com


Re: Problems while running route with the JBI Endpoint

2009-10-16 Thread Stan Lewis
The way you have your CXF endpoint configured you can only invoke on it via
soap/http.  You should have a look at the cxf-camel-nmr example shipped with
the FUSE ESB distribution, it shows how you can expose a web service via the
NMR and invoke on it from a Camel route which appears to be more like what
you're looking for.

On Fri, Oct 16, 2009 at 2:29 AM, sailaja p  wrote:

>
> Hi All,
>
>  I am trying to invoke a webservice using the JBI Endpoint. I got into
> problems. I goggled the errors, but no luck.
>
>  I have created a Bottom Up webservice and deployed it in FUSE ESB 4.2
> server and published it. Service is deployed properly and I am able to view
> the corresponding endpoints in the jconsole. Now I am trying to invoke this
> endpoint using JBI Endpoint in my camel route. When I run the route, I got
> the following exception.
>
>  My route looks like this:
>
>
>
> uri="jms:queue:Test">
>
> uri="jbi:endpoint:{http://sample.test/}HelloSampleService:HelloSamplePort
> ">
>
>
>
>  Following is xbean.xml of the created Webservice
>
>  http://sample.test/"; id="hellosample"
>implementor="test.sample.HelloSample"
> wsdlLocation="wsdl/hellosample.wsdl"
>endpointName="tns:HelloSamplePort"
> serviceName="tns:HelloSampleService"
>address="/HelloSamplePort">
>
> />
>
>
>
>
>
>  org.apache.camel.ResolveEndpointFailedException: Failed to resolve
> endpoint:
> jbi:endpoint:{http://sample.test/}HelloSampleService:HelloSamplePort due
> to:
> org.apache.camel.RuntimeCamelException: Could not auto create component:
> jbi
>at
>
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:357)
>at
>
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
>at
> org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:99)
>at
>
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
>at
>
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
>at org.apache.camel.model.SendType.resolveEndpoint(SendType.java:57)
>at org.apache.camel.model.SendType.createProcessor(SendType.java:51)
>at
>
> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:2011)
>at
>
> org.apache.camel.model.ProcessorType.createOutputsProcessor(ProcessorType.java:102)
>at
>
> org.apache.camel.model.InterceptorRef.createProcessor(InterceptorRef.java:66)
>at
> org.apache.camel.model.ProcessorType.makeProcessor(ProcessorType.java:1895)
>at
> org.apache.camel.model.ProcessorType.addRoutes(ProcessorType.java:106)
>at org.apache.camel.model.RouteType.addRoutes(RouteType.java:220)
>at org.apache.camel.model.RouteType.addRoutes(RouteType.java:89)
>at
>
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:670)
>at
>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:663)
>at
>
> org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:166)
>at
>
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:161)
>at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:53)
>at
>
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:607)
>at
>
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:96)
>at
>
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
>at
>
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>at
>
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>at
>
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>at
>
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>at
>
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
>at
>
> org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140)
>at
>
> org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:94)
>at
>
> com.fusesource.tools.eip.debug.launch.CamelStandinRuntime.doLaunchDebuggedContext(Unknown
> Source)
>at
> com.fusesource.tools.eip.debug.

Re: Camel on Google App Engine

2009-10-16 Thread James Strachan
2009/10/16 Martin Krasser :
>
> I'm trying to get camel-core running on Google App Engine. It doesn't run
> out-of-the-box mainly because Camel's UUID generator. It uses InetAddress
> that is not on the JRE class whitelist. Replacing the implementation using
> Java's UUID class, I got a simple route running.
>
> Is there any special reason why Camel doesn't use Java's UUID class for
> generating IDs? Do you see any issues replacing the current implementation?

No, it should work with the UUID class AFAIK. Our own UUID generator
is mostly a hang-over from JDK 1.4 and ActiveMQ - I don't see any
issues yet with using java.util.UUID. If we hit any we could make it
pluggable - but for simplicity maybe we should just switch?

> I'll summarize other issues with Camel on GAE in a separate post.

Great!
-- 
James
---
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/


Re: JmsComponent uses spring's deprecated class

2009-10-16 Thread Fintan Bolton

Also, Progress Software provides free (beta) documentation on its fusesource
open source Web site: http://fuseeip.fusesource.org/documentation/index.html
and at http://fusesource.com/products/enterprise-camel/

These docs are currently at version 1.6, but they will be updated to 2.0 in
a few weeks time.

Are there any specific aspects of the docs you would like to see improved?
Presumably, you would be interested in better docs for the JMS component and
transactions?

-
Fintan



linuca wrote:
> 
> 
> Claus Ibsen-2 wrote:
>> 
>> 
>>> A manual is here
>>> http://camel.apache.org/manual.html
>> 
>> I have already read this manual, it is good, but not good enough for me.
>> 
>>> Also use the google search bar in the front page of the camel website.
>> 
>> I've already tried this. There are examples, but I think they are not
>> complete enough.
>> 
>>> And another "decent manual" in the works
>>> http://twitter.com/davsclaus/statuses/4884255614
>> 
>> I'm so waiting for this manual! This is what I meant.
>> 
>> Thank you for your time!
>> 
>> Cheers.
>> 
>> 
>>> -- 
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JmsComponent-uses-spring%27s-deprecated-class-tp25897204p25923492.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.



Re: Feeding an Async Processor from an ActiveMQ topic

2009-10-16 Thread Claus Ibsen
On Thu, Oct 15, 2009 at 5:10 PM, Jörn Kottmann  wrote:
> Claus Ibsen wrote:
>>
>> Hi
>>
>> You only have 1 consumer listening on the JMS topic
>>     
>>
>> Try increasing this number.
>>
>
> JMS Topics can only have one concurrent consumer,
> so I guess I have to switch to a Queue, would it then
> run 100 threads for concurrentConsumers=100 ?
>

Yeah then you got 100 threads concurrently.
Remember more is not always better.

> Could instead of a transaction for each consumed message,
> the message acknowledgement be used to guarantee
> redelivery in case of an error ?
>


I do think you should use transactions as its what is there for.
But asking at the AMQ user forum can answer this more precisely what
the implications would be with ack mode only.




> Otherwise
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Camel on Google App Engine

2009-10-16 Thread Claus Ibsen
On Fri, Oct 16, 2009 at 9:47 AM, Martin Krasser  wrote:
>
> I'm trying to get camel-core running on Google App Engine. It doesn't run
> out-of-the-box mainly because Camel's UUID generator. It uses InetAddress
> that is not on the JRE class whitelist. Replacing the implementation using
> Java's UUID class, I got a simple route running.
>
> Is there any special reason why Camel doesn't use Java's UUID class for
> generating IDs? Do you see any issues replacing the current implementation?
>

Maybe James can remember?
I do think part of the reason was that then the id will reflect which
host created the it.
For example if you route messages over JMS then camel-jms could
preserve this id.

But I do think its much more important to get Camel compliant with the
white list on GAE.

I dont see any issue replacing it to a non host based. Or make it more
pluggable out of the box.

> I'll summarize other issues with Camel on GAE in a separate post.
>

Cool please post your findings.



> Thanks,
> Martin
> --
> View this message in context: 
> http://www.nabble.com/Camel-on-Google-App-Engine-tp25921155p25921155.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Camel on Google App Engine

2009-10-16 Thread Martin Krasser

I'm trying to get camel-core running on Google App Engine. It doesn't run
out-of-the-box mainly because Camel's UUID generator. It uses InetAddress
that is not on the JRE class whitelist. Replacing the implementation using
Java's UUID class, I got a simple route running.

Is there any special reason why Camel doesn't use Java's UUID class for
generating IDs? Do you see any issues replacing the current implementation?

I'll summarize other issues with Camel on GAE in a separate post.

Thanks,
Martin
-- 
View this message in context: 
http://www.nabble.com/Camel-on-Google-App-Engine-tp25921155p25921155.html
Sent from the Camel - Users mailing list archive at Nabble.com.