You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by iqbalzaveri <iq...@networkgeneral.com> on 2007/06/16 03:37:06 UTC

Setting compression through XML configuration

Hello,
I am trying to set compression for messages using XML config. Here's a
snapshot of the activemq.xml 
<!-- START SNIPPET: example -->
<beans>

  <!-- Allows us to use system properties as variables in this configuration
file -->
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  
  
  <connectionFactory useCompression="true" />
    
  <broker brokerName="localhost" useJmx="true"
xmlns="http://activemq.org/config/1.0">
.
..
...

        factory = new ActiveMQConnectionFactory(url);
        boolean isUseCompression =
((ActiveMQConnectionFactory)factory).isUseCompression();

This still returns 'false'. Am I missing something??
Expicitly setting useCompression in the code works fine. 

-iqz
-- 
View this message in context: http://www.nabble.com/Setting-compression-through-XML-configuration-tf3931260s2354.html#a11150167
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Setting compression through XML configuration

Posted by James Strachan <ja...@gmail.com>.
On 6/16/07, iqbalzaveri <iq...@networkgeneral.com> wrote:
>
> Hello,
> I am trying to set compression for messages using XML config. Here's a
> snapshot of the activemq.xml
> <!-- START SNIPPET: example -->
> <beans>
>
>   <!-- Allows us to use system properties as variables in this configuration
> file -->
>   <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>
>
>   <connectionFactory useCompression="true" />
>
>   <broker brokerName="localhost" useJmx="true"
> xmlns="http://activemq.org/config/1.0">
> .
> ..
> ...
>
>         factory = new ActiveMQConnectionFactory(url);



You are not looking up the ActiveMQConnectionFactory in spring.

All  <connectionFactory> does is define a spring bean which you can
lookup. So you probably wanna add an id attribute too

-- 
James
-------
http://macstrac.blogspot.com/

Re: Setting compression through XML configuration

Posted by keneida <ke...@o2.pl>.
You are setting the compression in the client configuration not tha AMQ
server



iqbalzaveri wrote:
> 
> Hello,
> I am trying to set compression for messages using XML config. Here's a
> snapshot of the activemq.xml 
> <!-- START SNIPPET: example -->
> <beans>
> 
>   <!-- Allows us to use system properties as variables in this
> configuration file -->
>   <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>   
>   
>   <connectionFactory useCompression="true" />
>     
>   <broker brokerName="localhost" useJmx="true"
> xmlns="http://activemq.org/config/1.0">
> .
> ..
> ...
> ***********
> In the code:
> 
>         factory = new ActiveMQConnectionFactory(url);
>         boolean isUseCompression =
> ((ActiveMQConnectionFactory)factory).isUseCompression();
> 
> This still returns 'false'. Am I missing something??
> Expicitly setting useCompression in the code works fine. 
> 
> -iqz
> 

-- 
View this message in context: http://www.nabble.com/Setting-compression-through-XML-configuration-tf3931260s2354.html#a11214115
Sent from the ActiveMQ - User mailing list archive at Nabble.com.