Deliver Zero Message Loss Environments That Scale

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

WHITEPAPER

   

 
Deliver  zero  message  loss  environments  that  scale
A  guide  to  cloud  messaging  with  Anypoint  MQ  and  Anypoint  Platform

 
Introduction  
 
Most  enterprises  need  to  change  the  way  they  operate,  which  is  driven  by  two  challenges.  First,  consumers  are  demanding  
that  everything  be  always  on  and  always  mobile.    This  puts  the  enterprise  under  tremendous  pressure  to  unlock  their  data  
and  processes  to  deliver  new  consumer  apps  and  open  new  digital  channels.    Second,  technology  is  now  adopted  by  every  
corner  of  the  enterprise.  This  means  the  demand  for  connectivity  between  technology  investments  within  and  outside  the  
enterprise  keeps  growing  rapidly.  It  also  means  the  cost  of  building  and  maintaining  connections  the  old  way  has  become  
unsustainable.    
 
Many  IT  organizations  have  tried  to  address  these  challenges  by  taking  old  operating  models  for  IT  and  pushing  them  
harder  and  faster.    As  those  approaches  weren’t  designed  for  automation  and  agility,  they  aren’t  working.    Instead,  
MuleSoft  recommends  a  modern  IT  operating  model  to  better  align  IT  outcomes  with  those  of  the  business,  an  approach  
we  call  API-­‐led  connectivity.  By  adopting  API-­‐led  connectivity,  the  most  successful  enterprises  are  creating  outcomes  
alignment  across  the  business,  delivering  on  IT  and  business  initiatives  quickly  through  an  application  network  that    
unlocks  critical  assets  and  ensures  information  flows  between  systems  reliably  and  securely  on  a  platform  built  to  scale.    
This  whitepaper  will  focus  on  how  organizations  can  use  messaging,  specifically  Anypoint  MQ  and  Anypoint  Platform,  to  
provide  reliable,  zero  message  loss  environments,  decouple  applications  to  enable  scale,  and  to  unlock  data  for  broader  
distribution.  

How  messaging  can  solve  enterprise  IT  challenges  


 
Increasingly,  organizations  must  act  in  real  time  to  connect  with  employees,  partners,  and  customers.  Messaging  plays  a  
critical  role  in  making  these  connections  and  has  become  a  critical  pattern  in  most  enterprise  architectures.    In  healthcare,  
for  example,  a  messaging  pattern  might  be  used  to  create  a  buffer  between  the  electronic  medical  records  system  and  any  
number  of  consuming  applications  who  need  to  know  when  a  patient  record  has  been  updated.  Or  in  retail,  a  messaging  
pattern  might  be  used  to  ensure  a  customer  can  have  a  seamless  experience  as  they  modify  their  shopping  cart  across,  in-­‐
store,  web,  and  mobile  channels.  Or  in  IoT  applications,  a  thermostat  can  use  a  message  queue  to  perform  an  over-­‐the-­‐air  
firmware  update  to  numerous  devices  distributed  across  the  world  to  roll  out  a  security  fix  or  an  application  enhancement.  
 
Generally,  messaging  enables  four  core  architectural  outcomes:  
 
Scalability  
By  decoupling  applications  with  a  traditional  asynchronous  publish/subscribe  messaging  pattern,  applications  that  publish  
messages  to  a  large  number  of  consumers  can  be  scaled  without  spinning  up  new  servers  or  infrastructure.    Asynchronous  
processing  also  enables  receiving  applications  to  operate  at  their  individual  peak  capability  without  affecting  other  
applications.  
 
 
Reliability  
By  enabling  both  the  sender  and  receiver  of  a  message  to  provide  acknowledgement  of  delivery  and  receipt,  messaging  
patterns  enable  zero  message  loss  reliability.    A  common  pattern  is  to  persist  a  message  in  a  queue  until  the  receiving  
application  has  acknowledged  receipt  as  both  successful  and  complete.    Similarly,  if  a  message  queue  supports  
idempotency,  the  receiver  can  block  duplicate  messages  to  avoid  creating  problems  in  the  receiving  application.            
 
Durability  
A  highly  available  message  queue  enables  architects  to  provide  guaranteed  delivery  either  at  least  once  or  only  once  
depending  on  the  desired  outcome.    These  fail  safes  enhance  the  durability  of  an  architecture.    If,  for  example,  a  receiver  
fails  in  processing  a  message  or  is  disconnected  while  processing  the  message,  the  message  can  be  stored  and  played  back  
 
by  the  sender  after  the  receiver  is  restarted.      
 
Data  consistency  
Sharing  data  between  applications  to  ensure  data  consistency  across  the  enterprise  is  becoming  a  top-­‐level  concern  for  
many  enterprise  architects.    With  a  messaging  layer  in  place,  enterprises  can  send  information  to  multiple  receivers  that  
need  to  be  kept  in  sync  regardless  of  where  they  are  located  -­‐-­‐  on-­‐premises  or  in  the  cloud.  

Figure 1. A typical publish/subscribe pattern with multiple queues and an exchange

Delivering  messaging  in  the  cloud  

Until  now,  most  messaging  has  been  driven  by  on-­‐premises  technology  requirements.    As  connectivity  moves  more  to  the  
cloud,  the  ability  to  deliver  messaging  patterns  in  the  cloud  and  connect  services  and  applications  located  globally  with  
zero  message  loss  reliability  becomes  increasingly  important.    That’s  why  MuleSoft  created  Anypoint  MQ.  
 
In  addition  to  the  four  outcomes  outlined  above,  Anypoint  MQ  provides:  
 
Hybrid  connectivity  
With  Anypoint  MQ,  queues  and  exchanges  live  in  the  cloud,  receive  messages  from  cloud  and  on-­‐premises  systems  and  
send  messages  to  cloud  and  on-­‐premises  systems,  increasing  both  operational  efficiency  and  architectural  agility.    
 
Global  connectivity    
On-­‐premise  technology  cannot  keep  up  with  the  information  generated  globally  from  proliferation  of  mobile  devices,  
wearables,  and  multitude  of  purchasing  channels.  Anypoint  MQ  is  available  in  multiple  regions  across  the  world  and  
supports  deployment  of  the  same  application  across  multiple  global  datacenters.  
 
Flexibility  
Different  types  of  applications  have  different  processing  times.  Anypoint  MQ  enables  throttling  through  which  individual  
applications  can  operate  at  their  peak  throughput  without  affecting  other  applications.  This  creates  flexibility  in  planning  
infrastructure  upgrades  instead  of  requiring  computing  infrastructure  to  be  well-­‐matched  across  applications.  
 
Security    
Anypoint  MQ  provides  out  of  the  box  industry  standard  passphrase  based  encryption  at  rest  for  messages  that  traverse  
through  the  queue.    As  a  service  of  Anypoint  Platform,  Anypoint  MQ  delivers  comprehensive  queue  and  client  
management  from  the  same  pane  of  glass  used  to  manage  APIs,  applications  and  other  Anypoint  Platform  resources.  
 
Figure 2. Secure queues and exchanges by enabling the ‘Encrypted’ option

Anypoint  MQ:  a  next  generation  messaging  solution  

With  Anypoint  MQ,  Anypoint  Platform  users  can  perform  advanced  asynchronous  messaging  scenarios  such  as  queueing  
and  pub/sub  with  fully  hosted  and  managed  cloud  message  queues  and  exchanges.    A  service  of  Anypoint  Platform,  
Anypoint  MQ  supports  environments,  business  groups,  and  role-­‐based  access  control  (RBAC)  to  help  you  deliver  seamless  
customer  experiences  across  channels  and  integrate  devices  reliably  for  Internet  of  Things  (IoT)  applications  with  
enterprise-­‐class  functionality.        
 
Specifically,  Anypoint  MQ  includes:  
 
Queues  and  Exchanges:  send  messages  to  queues,  pull  messages  from  queues,  or  create  a  message  exchange  to  perform  
pub/sub  scenarios  and  send  a  message  to  multiple  queues,  decoupling  applications  and  enabling  scale.  
Easy  connectivity:  send/receive  messages  from  any  Mule  application  running  in  the  cloud  or  on-­‐premises.  MuleSoft’s  REST  
API  allows  easy  interface  with  non-­‐Mule  applications.  
Secure,  reliable  message  delivery:  persistent  data  storage  across  multiple  data  centers,  ensuring  that  it  can  handle  data  
center  outages  and  have  full  disaster  recovery.  Queues  can  also  be  encrypted  so  data  at  rest  is  secured.  
Unified  management:  fully  integrated  with  Anypoint  Platform,  offering  role-­‐based  access  control,  client  application  
management,  queue  statistics  and  status  monitoring,  queue  management  and  environment  management  
 

 
Figure 3. Define user permissions by environment

NOTE:  Anypoint  MQ  is  not  currently  available  for  deployment  on-­‐premises.    For  customers  with  cloud  restrictions,  
MuleSoft  provides  pre-­‐built  connectivity  to  a  number  of  proprietary  and  legacy  messaging  on-­‐premises  messaging  
solutions,  including  MSMQ  and  IBM  Websphere  MQ  as  well  as  common  messaging  protocols  like  AMQP  and  JMS.  For  
customers  who  wish  to  have  a  fully  supported  on-­‐premises  messaging  deployment,  MuleSoft  provides  support  for  
ActiveMQ  when  used  in  conjunction  with  the  Mule  runtime  engine  in  a  predefined  set  of  use  cases.    For  more  information  
on  our  supported  ActiveMQ  offering,  please  contact  your  account  team.  

Using  Anypoint  MQ  


With  Anypoint  MQ,  MuleSoft  enables  customers  to  deliver  messaging  on  a  solution  designed  in  the  cloud,  making  it  fully  
elastic  and  multi-­‐tenanted  out  of  the  box.    Below,  we’ve  provided  a  few  examples  of  how  Anypoint  MQ  could  be  used.  
 
Routing  messages  to  cloud  and  on-­‐premises  systems  
Many  organizations  have  processes  in  place  for  updating  customer  records  in  their  cloud  CRM  -­‐-­‐  updates  that  on-­‐premises  
customer  DBs  and  ERPs  need  to  consume  to  keep  data  consistent.    Rather  than  sending  customer  updates  individually,  an  
unreliable  and  error  prone  pattern,  with  Anypoint  MQ  one  could  set  up  a  cloud  exchange  with  hybrid  connectivity.  
Through  this  exchange,  the  on-­‐premises  systems  could  subscribe  to  any  published  updates  from  the  cloud  application,  pull  
these  messages  down  into  their  respective  consumer  queues,  and  process  messages  at  their  own  pace.    By  putting  
acknowledgements  in  place  to  ensure  the  messages  are  received  and  processed  successfully,  this  would  provide  a  highly  
reliable  delivery  system.      
 

 
 
Figure  4.  A  diagram  showing  the  routing  of  cloud  messages  to  on-­‐premises  systems  

Competing  consumers  
Frequently  in  messaging  scenarios,  there  are  multiple  consumers  vying  to  receive  messages  from  a  single  point-­‐to-­‐point  
channel.  When  the  channel  delivers  a  message,  consumers  can  compete  with  each  other  to  be  the  receiver.  Once  a  
consumer  receives  a  message,  the  message  will  be  locked,  preventing  other  from  receiving  it  unless  the  lock  is  released.  
This  pattern  allows  tasks  to  be  efficiently  distributed  across  multiple  competing  workers  without  losing  tasks.  This  pattern  
is  used  when  balancing  the  processing  load  at  the  receiver  endpoints  or  to  optimize  throughput.    With  the  global  
connectivity  available  with  Anypoint  MQ,  throughput  can  be  further  optimized  by  delivering  messages  in  the  datacenter  
closest  to  the  receiving  application.    
 
Processing  peak  e-­‐commerce  traffic  around  Black  Friday  
E-­‐commerce  applications  running  in  the  cloud  typically  process  large  numbers  of  requests  from  multiple  distributed  
clients.  Processing  these  requests  synchronously  as  they  arrive  works  during  off-­‐peak  hours,  but  won’t  scale  to  handle  
peak  demand.    By  pushing  requests  into  a  cloud-­‐based  messaging  queue  and  then  allowing  other  services  to  process  these  
requests  asynchronously,  applications  won’t  block  requests  from  multiple  clients,  allowing  more  clients  to  connect  to  the  
application  and  place  orders,  providing  a  better  customer  experience  and  making  the  application  scalable  without  
requiring  massive  investment  in  servers  and  infrastructure.  
 
Supporting  microservices  and  service  oriented  architectures  
With  the  advent  of  microservices  architecture,  many  cloud  applications  involve  tasks  that  invoke  shared  services  such  as  a  
query  service  or  storage  service.  When  multiple  applications  invoke  these  shared  services,  it  may  overload  the  system  and  
result  in  the  service  failing  altogether.  A  message  queue  can  act  as  a  buffer  or  enabling  loose  coupling  between  the  
application  and  shared  services.    Delivering  this  queue  in  the  cloud  provides  the  flexibility  to  scale  up  and  down  in  line  with  
the  needs  of  the  respective  microservice.    
 
Compensating  transactions  
One  of  the  classic  cases  for  messaging  is  the  use  of  a  single  booking  web  service  to  book  a  flight,  hotel  room,  and  rental  car  
at  the  same  time.  The  booking  web  service  invokes  services  of  the  flight  booking  system,  the  hotel  booking  system  and  
the  rental  car  booking  system,  each  of  which  is  developed  and  architected  in  a  different  manner.  If  the  user  books  through  
the  service,  the  flight  and  rental  cars  get  confirmed,  but  the  hotel  room  is  no  longer  available  at  the  original  price,  the  
transaction  would  be  incomplete.  Without  a  compensating  transaction  roll  back,  either  the  consumer  of  the  booking  
service  or  booking  service  could  suffer  financial  loss.    Anypoint  MQ  provides  a  2  phase  commit  model  with  the  ability  to  
rollback  transactions  if  an  abort  response  is  ever  received  to  avoid  this  problem.    
 
 
IoT  applications  
As  consumers  become  more  tech  savvy  and  comfortable  using  connected  devices,  they  expect  their  home  security  
systems  to  talk  to  their  home  energy  management  systems  such  as  thermostat,  HVAC  and  lighting  controls.  For  example,  
a  user  could  arm  their  security  system  while  leaving  for  work  and  expect  the  security  system  to  set  back  the  thermostat  
temperature  setting  and  turn  off  lights  to  save  energy.  These  IoT  devices  have  serious  interoperability  issues  and  rarely  
communicate  with  each  other  at  the  physical  layers;  instead  many  of  these  devices  stream  data  to  device  clouds  managed  
by  different  vendors  which  are  part  of  different  ecosystems  such  as  Google’s  Brillo,  Apple’s  Homekit  or  Samsung’s  
Smartthings.  To  get  these  devices  working  together,  the  device  clouds  could  use  Anypoint  MQ  to  publish  and  subscribe  
encrypted  data  streams  of  interest,  thus  allowing  the  different  devices  to  communicate  with  each  other  in  a  highly  
scalable,  distributed,  protocol  agnostic,  and  secure  manner.  

Case  study  

One  of  the  world’s  leading  independent  biotechnology  companies  needed  a  reliable  way  of  sharing  patient  enrollment  and  
clinical  trial  assignment  details  coming  from  a  newly  purchased  third  party  system  across  a  number  of  cloud  and  on-­‐
premises  systems.    Familiar  with  ActiveMQ  and  needing  to  host  the  solution  in  the  cloud  to  reduce  operational  overhead  
and  ensure  scalability,  this  MuleSoft  customer  was  planning  to  purchase  and  manage  their  own  AWS  instance  with  
ActiveMQ  installed  when  they  discovered  Anypoint  MQ.  With  Anypoint  MQ,  they  were  able  to  deliver  a  cloud-­‐based  
exchange  with  cloud  and  on-­‐premises  subscribers  and  establish  receipt  criteria  to  ensure  each  subscriber  could  
acknowledge  message  delivery  and  receipt.    As  use  of  the  third  party  system  grows,  the  firm  is  confident  they’ll  be  able  
quickly  scale  their  implementation  and  manage  the  complex  messaging  use  cases  with  Anypoint  MQ.    By  removing  the  
burden  of  configuring  and  managing  their  own  cloud  ActiveMQ  deployment,  building  out  encryption  policies,  and  
delivering  highly  available  queues,  the  firm  is  able  to  instead  focus  on  the  intended  outcome  -­‐-­‐  ensuring  a  reliable  
consumer  experience.      

Conclusion  

With  Anypoint  MQ,  users  of  Anypoint  Platform  can  perform  advanced  asynchronous  messaging  scenarios  such  as  
queueing  and  pub/sub  with  fully  hosted  and  managed  cloud  message  queues  and  exchanges.    A  service  of  Anypoint  
Platform,  Anypoint  MQ  supports  environments,  business  groups,  and  role-­‐based  access  control  (RBAC)  providing  
simplified  management.    Finally,  Anypoint  MQ  helps  organizations  power  APIs  that  better  connect  assets  to  audiences,  
create  compelling  customer,  employee  and  partner  experiences,  and  allow  the  business  to  transform  and  succeed  in  
today’s  digital  world.  
 
To  access  Anypoint  MQ,  sign  up  for  a  trial  of  Anypoint  Platform  and  contact  your  account  team  to  ensure  the  trial  
Anypoint  MQ  entitlement  is  available  within  your  account.  
 
 
 

MuleSoft’s mission is to connect the world’s applications, data and devices. MuleSoft makes connecting anything easy with Anypoint Platform™, the only complete integration
platform for SaaS, SOA and APIs. Thousands of organizations in 60 countries, from emerging brands to Global 500 enterprises, use MuleSoft to innovate faster and gain competitive
advantage.

You might also like