camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to call external client using camel?
Date Fri, 27 Nov 2015 10:22:03 GMT
Well the stacktrace tells you that your computer cannot connect to that address

java.nio.channels.UnresolvedAddressException



On Fri, Nov 27, 2015 at 11:12 AM, deshmukh.yashodeep91@gmail.com
<deshmukh.yashodeep91@gmail.com> wrote:
>  I was trying to call a external client in an InOut pattern to exchange data.
> Basically i want to send some data to a third party site and in response i
> will get some data back. i tried using camel cxf but it not working and i
> also used camel spring-ws but not able to understand it. Currently i have
> made an camel-spring archetype project in which i was using camelContext.xml
> to build my route.
>
> <route>
>     <from uri="file:src/data?noop=true"/>
>     <log message="NextGen Track"/>
>     <setExchangePattern pattern="InOut"/>
>     <to pattern="InOut"
> uri="ahc:http://lnx142.us.dnb.com:8192/CommonServices/services/DNBCompanyService/match/"/>
>     </route>
>
>
> This code is giving me an error:
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> java.net.ConnectException: http://lnx142.us.dnb.com:8192
>     at
> com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:122)
>     at
> com.ning.http.client.providers.netty.request.NettyConnectListener.operationComplete(NettyConnectListener.java:134)
>     at
> org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:431)
>     at
> org.jboss.netty.channel.DefaultChannelFuture.addListener(DefaultChannelFuture.java:145)
>     at
> com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithNewChannel(NettyRequestSender.java:284)
>     at
> com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithCertainForceConnect(NettyRequestSender.java:140)
>     at
> com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequest(NettyRequestSender.java:115)
>     at
> com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:87)
>     at
> com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:486)
>     at
> com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.execute(AsyncHttpClient.java:225)
>     at
> org.apache.camel.component.ahc.AhcProducer.process(AhcProducer.java:54)
>     at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
>     at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
>     at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
>     at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
>     at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
>     at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:435)
>     at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)
>     at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)
>     at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>     at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
>     at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
>     at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
>     at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
> Source)
>     at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
> Source)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: java.nio.channels.UnresolvedAddressException
>     at sun.nio.ch.Net.checkAddress(Unknown Source)
>     at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
>     at
> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:108)
>     at
> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:70)
>     at
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:779)
>     at
> org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:54)
>     at
> org.jboss.netty.handler.codec.http.HttpClientCodec.handleDownstream(HttpClientCodec.java:97)
>     at
> org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
>     at
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784)
>     at
> org.jboss.netty.handler.stream.ChunkedWriteHandler.handleDownstream(ChunkedWriteHandler.java:109)
>     at
> org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
>     at
> org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
>     at org.jboss.netty.channel.Channels.connect(Channels.java:634)
>     at
> org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:207)
>     at
> org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:229)
>     at
> org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182)
>     at
> com.ning.http.client.providers.netty.request.NettyRequestSender.connect(NettyRequestSender.java:371)
>     at
> com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithNewChannel(NettyRequestSender.java:283)
>     ... 26 more
> [1) thread #2 - file://src/data] route1                         INFO
> NextGen Track
> [1) thread #2 - file://src/data] GenericFileOnCompletion        WARN
> Rollback file strategy:
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@1c0734d
> for file: GenericFile[message1.xml]
> [1) thread #2 - file://src/data] DefaultErrorHandler            ERROR Failed
> delivery for (MessageId: ID-PC241549-60923-1448605033535-0-23 on ExchangeId:
> ID-PC241549-60923-1448605033535-0-24). Exhausted after delivery attempt: 1
> caught: java.net.ConnectException: http://lnx142.us.dnb.com:8192
>
> Message History
> ---------------------------------------------------------------------------------------------------------------------------------------
> RouteId              ProcessorId          Processor
> Elapsed (ms)
> [route1            ] [route1            ] [file://src/data?noop=true
> ] [         2]
> [route1            ] [log1              ] [log
> ] [         0]
> [route1            ] [setExchangePattern] [setExchangePattern[InOut]
> ] [         0]
> [route1            ] [to1               ]
> [ahc:http://lnx142.us.dnb.com:8192/CommonServices/services/DNBCompanyService/ma]
> [         1]
>
> Exchange
> ---------------------------------------------------------------------------------------------------------------------------------------
> Exchange[
>     Id                  ID-PC241549-60923-1448605033535-0-24
>     ExchangePattern     InOut
>     Headers             {breadcrumbId=ID-PC241549-60923-1448605033535-0-23,
> CamelFileAbsolute=false,
> CamelFileAbsolutePath=D:\Jboss-Camel\workspace\NextGenTest\src\data\message1.xml,
> CamelFileContentType=text/xml, CamelFileLastModified=1448522047683,
> CamelFileLength=156, CamelFileName=message1.xml,
> CamelFileNameConsumed=message1.xml, CamelFileNameOnly=message1.xml,
> CamelFileParent=src\data, CamelFilePath=src\data\message1.xml,
> CamelFileRelativePath=message1.xml, CamelRedelivered=false,
> CamelRedeliveryCounter=0}
>     BodyType            org.apache.camel.component.file.GenericFile
>     Body                [Body is file based: GenericFile[message1.xml]]
> ]
>
>
> I am also confused that how would i get the response and store it. Thanks in
> advance for help.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-call-external-client-using-camel-tp5774475.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message