Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 28446 invoked from network); 8 Dec 2008 21:43:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2008 21:43:18 -0000 Received: (qmail 92056 invoked by uid 500); 8 Dec 2008 21:43:29 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 92025 invoked by uid 500); 8 Dec 2008 21:43:29 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 92014 invoked by uid 99); 8 Dec 2008 21:43:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Dec 2008 13:43:29 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.79.199.57] (HELO server.dankulp.com) (64.79.199.57) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Dec 2008 21:41:57 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id 60044197C25F; Mon, 8 Dec 2008 16:42:46 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.5-gr0 (2008-06-10) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.fflZfAn7Wo Received: from [192.168.1.101] (c-24-91-141-225.hsd1.ma.comcast.net [24.91.141.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTP id A97DD197C02C; Mon, 8 Dec 2008 16:42:44 -0500 (EST) From: Daniel Kulp To: users@cxf.apache.org Subject: Re: service creation & busfactory going to impact performance? Date: Mon, 8 Dec 2008 16:42:44 -0500 User-Agent: KMail/1.9.9 Cc: nmt999 References: <20903304.post@talk.nabble.com> In-Reply-To: <20903304.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812081642.44360.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.6 required=3.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.5-gr0 It really should have no impact. The default if you don't set it is to call BusFactory.getDefaultBus() anyway. My suggestion would be one of: 1) Keep one of your BasicReportService objects around. If you keep it around, the JAXBContext and such can be cached so it doesn't need to be recreated. That's part of the slowdown. 2) Just use a single BasicReportService object. Don't create a new one each time. Call: ((BindingProvider)ret).getRequestContext().put( "thread.local.request.context", Boolean.TRUE); and it will flip it to ThreadLocal storage for the request context which allows it to be mostly threadsafe (unless you turn on session support). Set the URL as needed via ((BindingProvider)ret).getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, aServiceURL); Dan On Monday 08 December 2008 3:54:04 pm nmt999 wrote: > Below is the code i use for creating service. Would it impact the memory or > performance if I use or do not use the setBus line that is commented. This > cxf client seems to take more time to run than the existing axis client and > also seems to use high cpu. not sure if i'm doing anything wrong. Also > these services get created for each account that the service is used for as > the service url differs from account to account > > > public BasicReportService createService(String aServiceURL) > { > BasicReportService ret = null; > > JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); > factory.getInInterceptors().add(new LoggingInInterceptor()); > factory.getOutInterceptors().add(new LoggingOutInterceptor()); > factory.setServiceClass(BasicReportService.class); > factory.setAddress(aServiceURL); > // factory.setBus(BusFactory.getDefaultBus()); > > ret = (BasicReportService) factory.create(); > > Client client = ClientProxy.getClient(ret); > HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); > > HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); > > httpClientPolicy.setConnectionTimeout(theService.DEFAULT_API_CONNECT_TIMEOU >T); > > httpClientPolicy.setReceiveTimeout(theService.DEFAULT_API_READ_TIMEOUT); > httpClientPolicy.setAllowChunking(false); > > httpConduit.setClient(httpClientPolicy); > > Debug.msg(Debug.INFORMATION, "BasicReportService created"); > return ret; > } -- Daniel Kulp dkulp@apache.org http://dankulp.com/blog