activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Buss <marco.b...@gmx.de>
Subject Re: BlobMessage - How to make it work?
Date Wed, 04 Jun 2008 12:05:50 GMT

Hello,

check if the blob is uploaded to the fileserver webapp. If the blob is
uploaded try this:

<bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory"
destroy-method="stop">
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL">
         
<value>http://xyz.16.233.50:61618?jms.blobTransferPolicy.uploadUrl=http://xyz.16.233.50:8161/fileserver/</value>
        </property>
<!-- default is true -->
        <property name="copyMessagesOnSend">
<!-- I am not sure if this works for boolean properties. If not search the
spring documentation how to inject booleans -->
          <value>false</value>
        </property>
      </bean>
    </property>
  </bean>

If this not work. Please provide a unit test for the problem.

regards
Marco Buss


balderman wrote:
> 
> Hi
> I am using ActiveMQ 5.1.
> I want to to use BlobMessage in order to send large amounts of data.
> When the consumer get the message  and the below code is executed:
>                  inputStream = blobMessage.getInputStream();
> the inputStream is null.
> I have seen few posts regarding this issue but I could not understand what
> is the right way to do it.
> More info:
> 1) The message sender and the message consumer run on my PC.
> 2) The message broker run on a different machine.
> 3) I am using Spring JMS template. Here is a config snippet of the Sender:
> (I replaced some part of the IP with xyz - but this is the IP of the
> message broker)
> ...
>   <bean id="jmsFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory"
> destroy-method="stop">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL">
>          
> <value>http://xyz.16.233.50:61618?jms.blobTransferPolicy.uploadUrl=http://xyz.16.233.50:8161/fileserver/</value>
>         </property>
>       </bean>
>     </property>
>   </bean>
> ...
> 4) Here is how I create the BlobMessage:
> blobMessage = activeMQSession.createBlobMessage(new File("path to the
> local file system here"));
> When I call blobMessage.getURL() I get null.
> If I create the message with a URL as argument:
> blobMessage = activeMQSession.createBlobMessage(new URL("url here"));
> the call to getURL() return a valid value. 
> 5) I know there is an option to use BlobTransferPolicy. Do I have to use
> it or the default is good enough?
> Please advice.
> 
> Thanks
> 
> Avishay
> 

-- 
View this message in context: http://www.nabble.com/BlobMessage---How-to-make-it-work--tp17644495s2354p17645127.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message