I change the connection option "copyMessageOnSend" to false, it still failed.. error :(if the option is true, everything is fine)
Exception in thread "main" 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:166) at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1577) at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:226) at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:240) at BlobMessagesQueue.BlobProducer.main(BlobProducer.java:24) Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.<init>(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source) 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:163) ... 4 more Sherif wrote: > > Hi, > > I had the same problem. I'm creating the blob message using: > > BlobMessage message = activeMQSession.createBlobMessage(File); > > The BlobMessage gets sent, but the consumer of the message will have a > null InputStream (and a null URL). Also, the REST fileserver application > did not receive the file (although the message is in the queue). > > When creating the BlobMessage using an URL, everything works fine. Both > the URL and InputStream are not null and the consumer is able to download > the message. > > I found a workaround for it though. If you set the "copyMessageOnSend" > option to false, things seems to work fine. > > I found this when looking at the behaviour when this option is activated > (by default). When the message is created with > activeMQSession.createBlobMessage(File), it sets the message's > blobUploader field. When the ActiveMQBlobMessage.copy() method is called, > it does not copy this field. The new message has a null blobUploader. > Then, when the ActiveMQBlobMessage.onSend() gets called, it does not > upload the file if the blobUploader field is null. > > Is this the expected behaviour or a bug? > > Sherif Behna > > -- View this message in context: http://www.nabble.com/Blob-Message-is-a-skin-game----not-real--%21---tf4260124s2354.html#a12176125 Sent from the ActiveMQ - User mailing list archive at Nabble.com.