Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2309A18288 for ; Fri, 27 Nov 2015 10:22:42 +0000 (UTC) Received: (qmail 89012 invoked by uid 500); 27 Nov 2015 10:22:39 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 88663 invoked by uid 500); 27 Nov 2015 10:22:38 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 88422 invoked by uid 99); 27 Nov 2015 10:22:38 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Nov 2015 10:22:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1C544C7B94 for ; Fri, 27 Nov 2015 10:22:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.014 X-Spam-Level: *** X-Spam-Status: No, score=3.014 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 1BVXKgVHOlfG for ; Fri, 27 Nov 2015 10:22:24 +0000 (UTC) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 9215223017 for ; Fri, 27 Nov 2015 10:22:23 +0000 (UTC) Received: by ioc74 with SMTP id 74so109189109ioc.2 for ; Fri, 27 Nov 2015 02:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=flJuTZ2ljJfVUMnWL731ffxsQi1kB0HNTl+GsjHQnO4=; b=N9Bml1ChksmwsJAS7L8m6Bsf954dti3sEkn/TRWq+TIVNU53RYufeR+yvYNlFbds4K wOtiXx/7vhBJdxjF4QlQ0h9nZXSFu7LLfUniCTbYVAQheDpoIUgk0B+DgScsd4DfuaNF ALMdT8Vd6FpjDOjo3Lbfhi5WrFtF6uMUccwhIWTnSPa3rIrn11DbvlyyoZMAuyKio3iw q3aAXIlWakcZWSU88jCEQ0wUD81CIkWoF3n7e6AWTBjKLS1QtDkMB2REV7YfObTjrrcC MxTuil0uQyvzcu3UqLHoOhx60BE4BmG7V+VjWlRCOYo0EFvz4d2NPuHCU/AKkffMM541 mTcw== X-Received: by 10.107.168.97 with SMTP id r94mr43888451ioe.181.1448619742556; Fri, 27 Nov 2015 02:22:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.117.85 with HTTP; Fri, 27 Nov 2015 02:22:03 -0800 (PST) In-Reply-To: <1448619151286-5774475.post@n5.nabble.com> References: <1448619151286-5774475.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 27 Nov 2015 11:22:03 +0100 Message-ID: Subject: Re: How to call external client using camel? To: dev Content-Type: text/plain; charset=UTF-8 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 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. > > > > > > uri="ahc:http://lnx142.us.dnb.com:8192/CommonServices/services/DNBCompanyService/match/"/> > > > > 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