activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From igah <weiqi...@mail.com>
Subject Re: Could not accept connection after too many messages in the queue
Date Wed, 18 Oct 2006 13:39:58 GMT


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

  <broker useJmx="true" persistent="true">
    <managementContext>
       <managementContext connectorPort="62629"
jmxDomainName="org.apache.activemq"/>
    </managementContext>

    <!-- In ActiveMQ 4, you can setup destination policies -->
    <destinationPolicy>
      <policyMap><policyEntries>
          <policyEntry topic="FOO.>">
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy />
            </subscriptionRecoveryPolicy>
          </policyEntry>
      </policyEntries></policyMap>
    </destinationPolicy>

    <persistenceAdapter>
        <jdbcPersistenceAdapter dataSource="#mysql-ds"/>
    </persistenceAdapter>

    <transportConnectors>
       <transportConnector name="default"
uri="tcp://localhost:62626?wireFormat.maxInactivityDuration=90000"
discoveryUri="multicast://default"/>
       <transportConnector name="stomp"   uri="stomp://localhost:62623"/>
    </transportConnectors>

    <networkConnectors>
    </networkConnectors>

  </broker>

  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
value="jdbc:mysql://localhost/activemq_test?relaxAutoCommit=true"/>
    <property name="username" value="activemq_ops"/>
    <property name="password" value="xxxxxx"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

</beans>


James.Strachan wrote:
> 
> Could you show us your activemq.xml you are using please?
> 
> On 10/17/06, igah <weiqingh@mail.com> wrote:
>>
>> btw, i just found out that the messages sent through stomp are never
>> saved to
>> mysql database. even if i remove journaling, my database tables are
>> empty.
>> is this related to the problem?
>>
>> i thought messages sent to queues are by default persistent. is that not
>> the
>> case with stomp? i also tried to add the message header "persistent" and
>> set
>> it to "true" (is that the right value to set?) in my ruby stomp client.
>> messages are still not saved. any suggestion is greately appreicated.
>>
>>
>> igah wrote:
>> >
>> > i have 25 message producers (wrtten in ruby), using stomp.  each
>> producer
>> > sends 1 message per second to the same queue. on the other side, i have
>> 10
>> > consumers (written in java) on the same queue. the connections are all
>> > created up-front. i am using mysql as the persistent store.
>> >
>> >     <persistenceAdapter>
>> >       <journaledJDBC journalLogFiles="5"
>> dataDirectory="../activemq-data"
>> > dataSource="#mysql-ds"/>
>> >     </persistenceAdapter>
>> >
>> > i got too many files opened error when the queue size exceeds
>> > (approximate) 34600. if i re-ran the test with longer think time for my
>> > message producers, therefore limiting QueueSize to smal or 0, then the
>> > test ran with no problem.
>> >
>> > i read on this forum about some other problems encountered while using
>> > stomp. is this related? how good is stomp support now?
>> >
>> > thanks in advance.
>> >
>> >
>> > James.Strachan wrote:
>> >>
>> >> Could you explain what you're doing? e.g. how many JMS connections are
>> >> you creating? Do you create them up front?
>> >>
>> >> http://incubator.apache.org/activemq/how-do-i-use-jms-efficiently.html
>> >>
>> >> On 10/13/06, igah <weiqingh@mail.com> wrote:
>> >>>
>> >>> yes, i ran out of file descriptors. but the question is why activemq
>> >>> opened
>> >>> so many sockets.
>> >>>
>> >>> when the load test started, iactivemq only has 90 files opened. if i
>> >>> have
>> >>> enough number of consumers to process the messages (therefore
>> QueueSize
>> >>> is
>> >>> always almost 0), then it never opens any more sockets.
>> >>>
>> >>> when the number of consumers is decreased and there is a large
>> backlog
>> >>> on
>> >>> the queue,  activemq suddently opens more and more sockets till it
>> hits
>> >>> the
>> >>> ulimit (1024) when it throws the exceptions.
>> >>>
>> >>>
>> >>> James.Strachan wrote:
>> >>> >
>> >>> > It looks like you are just running out of file descriptors; file
>> >>> > descriptors are used for sockets as well as files and other OS
>> things.
>> >>> > Usually its a simple change on your OS to bump that value up to
>> >>> > something much higher.
>> >>> >
>> >>> > On 10/13/06, igah <weiqingh@mail.com> wrote:
>> >>> >>
>> >>> >> hi there,
>> >>> >>
>> >>> >> i have a number of stomp clients that post messages continously
to
>> a
>> >>> >> single
>> >>> >> queue. if the consumer on that queue doesn't process the messages
>> >>> fast
>> >>> >> enough, i am seeing this error in the activemq (version 4.0.1)
>> log:
>> >>> >>
>> >>> >> ERROR TransportConnector             - Could not accept
>> connection:
>> >>> >> java.net.SocketException: Too many open files
>> >>> >> java.net.SocketException: Too many open files
>> >>> >>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>> >>> >>         at
>> java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
>> >>> >>         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
>> >>> >>         at java.net.ServerSocket.accept(ServerSocket.java:421)
>> >>> >>         at
>> >>> >>
>> >>>
>> org.apache.activemq.transport.tcp.TcpTransportServer.run(TcpTransportServer.java:123)
>> >>> >>         at java.lang.Thread.run(Thread.java:595)
>> >>> >>
>> >>> >> jmx console shows that the following for the queue:
>> >>> >> DequeueCount 6847
>> >>> >> EnqueueCount 40800
>> >>> >> QueueSize 34593
>> >>> >>
>> >>> >> lsof shows the activemq process opens about 1000 files (most
of
>> them
>> >>> TCP
>> >>> >> sockets) at the time of the failure. if i add more consumers
to
>> >>> process
>> >>> >> those messages, then the test can run for a long time with
no
>> >>> failure.
>> >>> >>
>> >>> >> how can i address this issue? am i missing some tuning
>> configuration
>> >>> >> parameters? (the activemq instance is configured to use mysql)
>> >>> >>
>> >>> >> thanks in advance.
>> >>> >>
>> >>> >> --
>> >>> >> View this message in context:
>> >>> >>
>> >>>
>> http://www.nabble.com/Could-not-accept-connection-after-too-many-messages-in-the-queue-tf2437563.html#a6797112
>> >>> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >>> >>
>> >>> >>
>> >>> >
>> >>> >
>> >>> > --
>> >>> >
>> >>> > James
>> >>> > -------
>> >>> > http://radio.weblogs.com/0112098/
>> >>> >
>> >>> >
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://www.nabble.com/Could-not-accept-connection-after-too-many-messages-in-the-queue-tf2437563.html#a6799518
>> >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >>
>> >> James
>> >> -------
>> >> http://radio.weblogs.com/0112098/
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Could-not-accept-connection-after-too-many-messages-in-the-queue-tf2437563.html#a6858433
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Could-not-accept-connection-after-too-many-messages-in-the-queue-tf2437563.html#a6876435
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message