activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Fernandez <joe.fernan...@ttmsolutions.com>
Subject Re: Starting Jetty to serve blobs with embedded broker
Date Tue, 05 Aug 2008 13:10:20 GMT

Hi Eugeny,

You can try starting the embedded broker with a brokerURL that specifies a
config file, and have the config file include a <jetty> element. 

With this brokerURL the cfg file must be in the application’s CLASSPATH. 
vm://localbroker?brokerConfig=xbean:activemq.xml

With this one, you're specifying an absolute path to the cfg file.
vm://localbroker?brokerConfig=xbean:file:C:/tmp/activemq.xml


Here's an example file with the <jetty> element. 
<beans>

  <!-- Allows us to use system properties as variables in this configuration
file -->
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  
 <broker brokerName="broker0" xmlns="http://activemq.org/config/1.0">            
    <managementContext>
       <managementContext connectorPort="1599"
jmxDomainName="org.apache.activemq"/>
    </managementContext>
    <!-- The transport connectors ActiveMQ will listen to -->
    <transportConnectors>
      <transportConnector name="openwire" uri="tcp://localhost:61616" />     
    </transportConnectors>
    
  </broker>

<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
    <connectors>
      <nioConnector port="8161" />
    </connectors>

    <handlers>
      <webAppContext contextPath="/admin"
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true" />
      <webAppContext contextPath="/demo"
resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true" />
      <webAppContext contextPath="/fileserver"
resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true" />
    </handlers>
</jetty>
</beans>

Hope this helps. 

Joe
http://www.ttmsolutions.com - get a free ActiveMQ user guide


Eugeny N Dzhurinsky-2 wrote:
> 
> Hello, all!
> 
> Could somebody please advice how can I start the embedded Jetty server
> when
> starting ActiveMQ from the application using embedded brokers?
> 
> I need to serve blobs, and looks like the default Jetty server is not
> started
> when broker is created, thus blobs aren't uploaded and
> BlobMessage.getInputStream()
> returns null.
> 
> Thank you in advance!
> 
> -- 
> Eugene N Dzhurinsky
> 
> 

-- 
View this message in context: http://www.nabble.com/Starting-Jetty-to-serve-blobs-with-embedded-broker-tp18826446p18830817.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message