poniedziałek, czerwca 03, 2013

EMS planetary pattern


EMS server holds its state and message structures in memory and therefore has a limit for maximal number of messages. Considering compiler options and memory alignment EMS server requires about 0,5KB per one JMS message. With EMS server using 4GB RAM you can have 8 mln messages.
When memory limit of EMS server is too low you can refactor your infrastructure with planetary pattern:
Applications have their local EMS instances with routing enabled towards master server and defined proxy queues:
billing.data@EMS-SERVER-MASTER store=$sys.failsafe,secure
billing.voice@EMS-SERVER-MASTER store=$sys.failsafe,secure
billing.premium@EMS-SERVER-MASTER store=$sys.failsafe,secure

Master server has limits forced on these queues:
billing.data@EMS-SERVER-MASTER store=$sys.failsafe,secure,maxmsgs=1000000
billing.voice@EMS-SERVER-MASTER store=$sys.failsafe,secure,maxmsgs=1000000
billing.premium@EMS-SERVER-MASTER store=$sys.failsafe,secure,maxmsgs=1000000

When you send messages to local server's queue and master server still has got free capacity - they are routed. When master's limit is reached messages are stored on local server - until master regained capacity.
With EMS planetary pattern you can get rid of EMS server memory limits. If client connects to EMS server via JNDI it can be transparently redirected to other server, so you can migrate easily from single server to planetary infrastructure. If connection factory config is taken from local JNDI you can add additional server behind local EMS without reconfiguring client.

0 komentarze: