activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Anderson <manderso...@gmail.com>
Subject Re: Memory and Temp Usage Questions
Date Tue, 27 Nov 2012 11:46:53 GMT
The server is configured in code as follows:

    BrokerService broker = new BrokerService();
    broker.setBrokerName(brokerName);
    // enable persistence so that temp storage can be used
    broker.setPersistent(true);
    broker.setDataDirectory(dataDirectory);
    broker.setSchedulerSupport(false);

    broker.addConnector("tcp://0.0.0.0:24726");  // 24726 peer to peer
    broker.addConnector("tcp://0.0.0.0:24727");  // 24727 client to server

    // set the default policy to be used by all queues and topics
    // disable producer flow control so that producers don't block and
    // temp storage is used if memory limit is reached
    PolicyMap policyMap = new PolicyMap();
    PolicyEntry defaultPolicy = new PolicyEntry();
    defaultPolicy.setProducerFlowControl(false);
    policyMap.setDefaultEntry(defaultPolicy);
    // we want to limit the live server domain events topic to 20k pending
msg
    // to prevent messaging to the historical server locking up
    PolicyEntry liveServerDomainEventsPolicy = new PolicyEntry();
    ConstantPendingMessageLimitStrategy constantPendingMessageLimitStrategy
= new ConstantPendingMessageLimitStrategy();
    constantPendingMessageLimitStrategy.setLimit(20000);

liveServerDomainEventsPolicy.setPendingMessageLimitStrategy(constantPendingMessageLimitStrategy);
    policyMap.put(new ActiveMQTopic("liveServerDomainEvents"),
liveServerDomainEventsPolicy);
    broker.setDestinationPolicy(policyMap);

    // adjust default memory settings
    SystemUsage systemUsage = broker.getSystemUsage();
    // enable failure exception as last resort if memory fills otherwise
producers will block
    systemUsage.setSendFailIfNoSpace(true);
    // set in memory limit to 128Mb
    // set temp storage to 1Gb
    // store is not used as all messages are non-persistent
    systemUsage.getMemoryUsage().setLimit(128000000);
    systemUsage.getTempUsage().setLimit(1000000000);

    // optionally connect to a peer broker
    // this will be set on spoke nodes
    if (peerAddress != null)
    {
      URI uri = new URI("static:(tcp://" + peerAddress + ":" + jmsPortPeer
+
")?initialReconnectDelay=5000&useExponentialBackOff=false&jms.prefetchPolicy.topicPrefetch=32766");

      NetworkConnector networkConnector = new
PeerNetworkConnector(peerAddress, uri, this);
      networkConnector.setName("peerConnector-" + peerAddress);
      networkConnector.setDuplex(true);
      networkConnector.setNetworkTTL(networkTTL);
      networkConnector.setPrefetchSize(32766);
      broker.addNetworkConnector(networkConnector);
    }

    ManagementContext managementContext = new ManagementContext();
    managementContext.setCreateConnector(false);
    broker.setManagementContext(managementContext);
    broker.setUseShutdownHook(false);
    broker.start();

    // broker.start() is asynchronous so wait
    // don't want to accidently create an embedded broker
    broker.waitUntilStarted();

The error happened on a customer system so creating a JUnit test case could
be difficult as we have not yet been able to reproduce in our test
environement.


On 27 November 2012 11:11, Gary Tully <gary.tully@gmail.com> wrote:

> can you post your xml configuration to clarify. Even better, if you can
> produce a junit test case that can reproduce it would help get to the
> bottom of this.
>
>
> w.r.t to  AMQ-3643, it is a long way down on the priority list but is
> something that is on the radar.
>
> On 27 November 2012 09:22, Mark Anderson <manderson23@gmail.com> wrote:
>
> > AMQ-3643
>
>
>
>
> --
> http://redhat.com
> http://blog.garytully.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message