You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by krv <vi...@onmobile.com> on 2007/10/31 08:02:14 UTC
Receiving messages over HTTP connection
I need to write a consumer to receive messages over a HTTP connection (HTTP
transport connector). Can anyone point me to some useful documents for the
same?
And the consumer is outside the firewall.
--
View this message in context: http://www.nabble.com/Receiving-messages-over-HTTP-connection-tf4723207s2354.html#a13503889
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: How to receive messages over HTTP connection?
Posted by krv <vi...@onmobile.com>.
I thing I seem to have found the problem myself. I was using the latest
SNAPSHOT (25 Oct, 07) version to send and receive messages over HTTP
connection. While sending messages works fine receiving messages doesn't.
When I reverted to the stable version 4.1.1 both sending and receiving seem
to work fine over HTTP connection.
Is this a potential bug? Is this gonna be fixed in the 5.0 version?
Can anyone comment on this please.
Thanks again in advance.
krv wrote:
>
> Thanks for your reply. I am able to send messages to ActiveMQ but the
> consumer is not receiving any messages sent by the producer. If I revert
> back the configurations to use tcp everything is fine.
>
> Below is the configuration I have used:
> <!-- The transport connectors ActiveMQ will listen to -->
> <transportConnectors>
> <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
> <transportConnector name="ssl" uri="ssl://localhost:61617"/>
> <transportConnector name="stomp" uri="stomp://localhost:61613"/>
> <transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
> <transportConnector name="http" uri="http://localhost:61224"/>
> </transportConnectors>
>
> Consumer configuration:
> <bean id="connectionFactory"
> class="org.jencks.amqpool.JcaPooledConnectionFactory">
> <constructor-arg value="failover://(http://localhost:61224)" />
> <property name="maxConnections" value="8" />
> <property name="transactionManager" ref="transactionManager" />
> <property name="name" value="LocalBroker" />
> </bean>
>
> <bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"
> autowire="constructor">
> <constructor-arg>
> <value>MoMessageVOQueue</value>
> </constructor-arg>
> </bean>
>
> <bean id="messageVoConsumer"
> class="com.onmobile.mcmo.servlet.MOMsgVOConsumer" init-method="start"
> destroy-method="stop">
> <constructor-arg>
> <ref bean="connectionFactory"/>
> </constructor-arg>
> <constructor-arg>
> <ref bean="destination"/>
> </constructor-arg>
> </bean>
>
> Also I am getting the following warning in the ActiveMQ console:
> WARN ManagedTransportConnection - Failed to unregister mbean:
> org.apache.activemq:BrokerName=OM-BLR-LT-0657,Type=Connection,ConnectorName=http,ViewType=address,Name=blockingQueue
>
> Let me know if I'm missing anything here.
> Thanks in advance.
>
>
> ttmdev wrote:
>>
>> To connect to the broker, your client (consumer) will need to use a http
>> broker URL as follows
>>
>> http://broker-ip-address:port-number
>>
>> The broker will need to have a http transport connector to listen for
>> http connection requests from the clients as follows
>>
>> <transportConnectors>
>> <transportConnector name="http"
>> uri="http://broker-ip-address:port-number" />
>> </transportConnectors>
>>
>> These jar files will have to be in your client's CLASSPATH
>>
>> $ACTIVEMQ_HOME/activemq-<release number>.jar
>> $ACTIVEMQ_HOME/lib/optional/commons-httpclient-2.0.1.jar
>> $ACTIVEMQ_HOME/lib/optional/xstream-1.1.2.jar
>> $ACTIVEMQ_HOME/lib/optional/xmlpull-1.1.3.4d_b4_min.jar
>>
>> Hope this helps,
>> Joe
>>
>>
>>
>> krv wrote:
>>>
>>> I need to write a consumer to receive messages over a HTTP connection
>>> (HTTP transport connector). Can anyone point me to some useful documents
>>> for the same?
>>> And the consumer is outside the firewall.
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-receive-messages-over-HTTP-connection--tf4723207s2354.html#a13526460
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: How to receive messages over HTTP connection?
Posted by krv <vi...@onmobile.com>.
Thanks for your reply. I am able to send messages to ActiveMQ but the
consumer is not receiving any messages sent by the producer. If I revert
back the configurations to use tcp everything is fine.
Below is the configuration I have used:
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
<transportConnector name="http" uri="http://localhost:61224"/>
</transportConnectors>
Consumer configuration:
<bean id="connectionFactory"
class="org.jencks.amqpool.JcaPooledConnectionFactory">
<constructor-arg value="failover://(http://localhost:61224)" />
<property name="maxConnections" value="8" />
<property name="transactionManager" ref="transactionManager" />
<property name="name" value="LocalBroker" />
</bean>
<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"
autowire="constructor">
<constructor-arg>
<value>MoMessageVOQueue</value>
</constructor-arg>
</bean>
<bean id="messageVoConsumer"
class="com.onmobile.mcmo.servlet.MOMsgVOConsumer" init-method="start"
destroy-method="stop">
<constructor-arg>
<ref bean="connectionFactory"/>
</constructor-arg>
<constructor-arg>
<ref bean="destination"/>
</constructor-arg>
</bean>
Also I am getting the following warning in the ActiveMQ console:
WARN ManagedTransportConnection - Failed to unregister mbean:
org.apache.activemq:BrokerName=OM-BLR-LT-0657,Type=Connection,ConnectorName=http,ViewType=address,Name=blockingQueue
Let me know if I'm missing anything here.
Thanks in advance.
ttmdev wrote:
>
> To connect to the broker, your client (consumer) will need to use a http
> broker URL as follows
>
> http://broker-ip-address:port-number
>
> The broker will need to have a http transport connector to listen for http
> connection requests from the clients as follows
>
> <transportConnectors>
> <transportConnector name="http"
> uri="http://broker-ip-address:port-number" />
> </transportConnectors>
>
> These jar files will have to be in your client's CLASSPATH
>
> $ACTIVEMQ_HOME/activemq-<release number>.jar
> $ACTIVEMQ_HOME/lib/optional/commons-httpclient-2.0.1.jar
> $ACTIVEMQ_HOME/lib/optional/xstream-1.1.2.jar
> $ACTIVEMQ_HOME/lib/optional/xmlpull-1.1.3.4d_b4_min.jar
>
> Hope this helps,
> Joe
>
>
>
> krv wrote:
>>
>> I need to write a consumer to receive messages over a HTTP connection
>> (HTTP transport connector). Can anyone point me to some useful documents
>> for the same?
>> And the consumer is outside the firewall.
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-receive-messages-over-HTTP-connection--tf4723207s2354.html#a13525225
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: How to receive messages over HTTP connection?
Posted by ttmdev <jo...@ttmsolutions.com>.
To connect to the broker, your client (consumer) will need to use a http
broker URL as follows
http://broker-ip-address:port-number
The broker will need to have a http transport connector to listen for http
connection requests from the clients as follows
<transportConnectors>
<transportConnector name="http"
uri="http://broker-ip-address:port-number" />
</transportConnectors>
These jar files will have to be in your client's CLASSPATH
$ACTIVEMQ_HOME/activemq-<release number>.jar
$ACTIVEMQ_HOME/lib/optional/commons-httpclient-2.0.1.jar
$ACTIVEMQ_HOME/lib/optional/xstream-1.1.2.jar
$ACTIVEMQ_HOME/lib/optional/xmlpull-1.1.3.4d_b4_min.jar
Hope this helps,
Joe
krv wrote:
>
> I need to write a consumer to receive messages over a HTTP connection
> (HTTP transport connector). Can anyone point me to some useful documents
> for the same?
> And the consumer is outside the firewall.
>
--
View this message in context: http://www.nabble.com/How-to-receive-messages-over-HTTP-connection--tf4723207s2354.html#a13512189
Sent from the ActiveMQ - User mailing list archive at Nabble.com.