From users-return-22630-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Fri Feb 26 09:42:59 2010 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 81666 invoked from network); 26 Feb 2010 09:42:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Feb 2010 09:42:59 -0000 Received: (qmail 12459 invoked by uid 500); 26 Feb 2010 09:42:59 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 12430 invoked by uid 500); 26 Feb 2010 09:42:59 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 12422 invoked by uid 99); 26 Feb 2010 09:42:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 09:42:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 209.85.220.222 as permitted sender) Received: from [209.85.220.222] (HELO mail-fx0-f222.google.com) (209.85.220.222) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 09:42:49 +0000 Received: by fxm22 with SMTP id 22so7799103fxm.6 for ; Fri, 26 Feb 2010 01:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=oW2eENKnMaZZmkWjr4i4dYrhBvNFWl3Mi0A4o1ZNYCU=; b=PbybrYNozeuFR0mHEDJItvjfFSDNQ1JfxIbn+eV+oB0v8H9tlmH7nr3t0PhkhjAw4M 34NLdvuti8KRUu9uZsuu09QCh25IqtxEvuB5ww6c6g1DOWgRxZyLbcYAO7mFuxBMX7yo kuGYfnD+esaY5I8Ehcg9DDUFv40NCLyJV6msc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=P23EwQdyFJrIUaVkKBQKVpQsJ5+BL/2jLXsO777CMJwXAh2DE5HdD6zQhB5ktXeIi4 FMtUjoeMaoWc/YFEG6RH4qG9/rLKX+96wvtlxbeecJNYzwA8Xu7WLcN/u4sDcOtwGUoH elop6vmf68jf1jisUYy+qlgGQJpDfqDAgQu1E= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.239.193.136 with SMTP id j8mr7924hbi.200.1267177346456; Fri, 26 Feb 2010 01:42:26 -0800 (PST) In-Reply-To: <27714556.post@talk.nabble.com> References: <27714556.post@talk.nabble.com> Date: Fri, 26 Feb 2010 10:42:26 +0100 X-Google-Sender-Auth: c0aed10850de8f38 Message-ID: <36e91d9d1002260142y17709af3r80fa5dacd20d01e9@mail.gmail.com> Subject: Re: Connection Fails when trying to send Blob Message From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=001485f631129a5bc104807db780 --001485f631129a5bc104807db780 Content-Type: text/plain; charset=ISO-8859-1 Hi, the blob messages require another server (http or ftp), as messages are uploaded/downloaded from that server and only reference is sent to the broker. So you need to have either separate http or ftp server up and running, check out some of the unit tests for more info on the topic http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/blob Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Fri, Feb 26, 2010 at 1:01 AM, bzaks1424 wrote: > > I am trying to send a BlobMessage to a "remote" queue (in this case just to > the "localhost" queue) in ActiveMQ. Whenever I issue the send command from > the producer - the connection is refused. I'll try to provide as much > information as I can. > > I'm also *really* new to ActiveMQ. So If you have any suggestions in my > coding practices I'm all ears! (Or I suppose 'eyes' would have to do in > this > case) > > Tests Performed: > I can enqueue other objects (TextMessage, ObjectMessage....) > I can telnet to the port from my command line (telnet localhost 61616) > > Environment: > Windows XP (SP3) > No Firewall > Java 1.6 > > Code: > try { > StringBuffer brokerURL = new StringBuffer("tcp://") > .append("exampleHost"); > if (destinationPort == null) { > // Use the default > brokerURL.append(":").append("61616"); > } else { > brokerURL.append(":").append(destinationPort); > } > > ActiveMQConnectionFactory factoryBean = null; > Connection connection = null; > ActiveMQSession session = null; > MessageProducer producer = null; > try { > factoryBean = new ActiveMQConnectionFactory(brokerURL > .toString()); > connection = factoryBean.createConnection(); > connection.start(); > session = (ActiveMQSession) connection.createSession(false, > Session.AUTO_ACKNOWLEDGE); > Destination payloadQueue = session > .createQueue("com.example.payload"); > producer = session.createProducer(null); > BlobMessage blobMessage = session > > .createBlobMessage(remoteWorkItemTO.getPayload()); > blobMessage.setStringProperty("FILENAME",fileName); > blobMessage.setLongProperty("JOB_ID",jobId); > producer.send(payloadQueue, blobMessage); > > } finally { > try { > producer.close(); > session.close(); > connection.stop(); > connection.close(); > } catch (Exception e) { > // Ignore it. > } > } > } catch (Exception e) { > e.printStackTrace(); > } > > Abridged Stack Trace: > javax.jms.JMSException: Connection refused: connect > at > > org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) > at > > org.apache.activemq.command.ActiveMQBlobMessage.onSend(ActiveMQBlobMessage.java:176) > at > org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1674) > at > > org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:231) > at > > org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:300) > .......... > Caused by: java.net.ConnectException: Connection refused: connect > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > at > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > at java.net.Socket.connect(Socket.java:525) > at java.net.Socket.connect(Socket.java:475) > at sun.net.NetworkClient.doConnect(NetworkClient.java:163) > at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) > at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) > at sun.net.www.http.HttpClient.(HttpClient.java:233) > at sun.net.www.http.HttpClient.New(HttpClient.java:306) > at sun.net.www.http.HttpClient.New(HttpClient.java:323) > at > > sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860) > at > > sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801) > at > > sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726) > at > > sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904) > at > > org.apache.activemq.blob.DefaultBlobUploadStrategy.uploadStream(DefaultBlobUploadStrategy.java:59) > at > > org.apache.activemq.blob.DefaultBlobUploadStrategy.uploadFile(DefaultBlobUploadStrategy.java:44) > at > org.apache.activemq.blob.BlobUploader.upload(BlobUploader.java:51) > at > > org.apache.activemq.command.ActiveMQBlobMessage.onSend(ActiveMQBlobMessage.java:173) > ... 37 more > -- > View this message in context: > http://old.nabble.com/Connection-Fails-when-trying-to-send-Blob-Message-tp27714556p27714556.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > --001485f631129a5bc104807db780--