Habari Client for Openmq Version 3.4 2 Habari Client for Openmq 3.4
Total Page:16
File Type:pdf, Size:1020Kb
Getting started with Habari Client for OpenMQ Version 3.4 2 Habari Client for OpenMQ 3.4 Trademarks Habari is a trademark or registered trademark of Michael Justin in Germany and/or other countries. Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. Embarcadero, the Embarcadero Technologies logos and all other Embarcadero Technologies product or service names are trademarks, service marks, and/or registered trademarks of Embarcadero Technologies, Inc. and are protected by the laws of the United States and other countries. IBM and WebSphere are trademarks of International Business Machines Corporation in the United States, other countries, or both. HornetQ, WildFly, JBoss and the JBoss logo are registered trademarks or trademarks of Red Hat, Inc. Mac OS is a trademark of Apple Inc., registered in the U.S. and other countries. Oracle, WebLogic and Java are registered trademarks of Oracle and/or its affiliates. Pivotal, RabbitMQ and the RabbitMQ logo are trademarks and/or registered trademarks of GoPivotal, Inc. in the United States and/or other countries. Other brands and their products are trademarks of their respective holders. 3 Contents Broker-specific information..............................................................................6 Installation...........................................................................................7 Requirements...................................................................................................7 Development Environment................................................................................7 TCP/IP Communication Library...........................................................................7 Log4D logging framework.................................................................................7 Installation steps.............................................................................................7 Communication Adapters......................................................................8 Introduction.....................................................................................................8 Configuration of communication adapters............................................................8 Registration of communication adapter class.......................................................8 Available communication adapters.....................................................................9 Limitations of the Synapse communication adapter class.......................................9 SSL communication adapter classes...................................................................9 The Programming Model.....................................................................10 Tutorials..............................................................................................11 Quick Start Tutorial........................................................................................11 Setting up the project.....................................................................................11 Adding code to the project..............................................................................11 Run the demo................................................................................................13 Check for memory leaks..................................................................................13 Tutorial source code.......................................................................................13 Map Message Tutorial.....................................................................................14 Setting up the project.....................................................................................14 Adding code to the project..............................................................................14 Run the demo................................................................................................16 Map Message Conversion with Apache ActiveMQ.................................................16 Tutorial source code.......................................................................................16 Connections and Sessions...................................................................17 Step-by-Step Example....................................................................................17 Overview......................................................................................................17 Add required units..........................................................................................17 Creating a new Connection..............................................................................17 Connection URL Parameters.............................................................................18 Creating a Session.........................................................................................18 Using the Session...........................................................................................18 Closing a Connection......................................................................................18 Session types overview..................................................................................19 Connection URL parameters...........................................................................20 Message Receipts...........................................................................................20 Subscription Receipts......................................................................................20 Disconnect Receipts........................................................................................20 TCP Keep-Alive (only supported with Indy)........................................................21 Heart-beating Support....................................................................................21 Transacted Sessions.......................................................................................22 4 Habari Client for OpenMQ 3.4 Create a transacted session.............................................................................22 Send messages..............................................................................................22 Committing a transaction................................................................................22 Rolling back a transaction................................................................................23 Transacted message acknowledgement.............................................................23 Failover Support.............................................................................................24 Failover Transport Options...............................................................................24 Pooled Connection Factory.............................................................................25 Destinations........................................................................................27 Introduction...................................................................................................27 Create a new Destination...............................................................................27 Queues.........................................................................................................27 Topics...........................................................................................................28 Producer and Consumer......................................................................29 Message Producer..........................................................................................29 Message Consumer.........................................................................................29 Synchronous.................................................................................................29 Asynchronous................................................................................................30 Synchronous Receive......................................................................................30 Should I use synchronous receive or IMessageListener?......................................30 Durable Subscriptions.........................................................................31 Description.....................................................................................................31 Creation........................................................................................................31 Examples......................................................................................................31 Temporary Queues..............................................................................32 Introduction...................................................................................................32 Library Support..............................................................................................32 Resource Management....................................................................................32 Message Options.................................................................................33 JMS Standard Properties................................................................................33 JMS properties for outgoing messages..............................................................33 JMS properties for incoming messages..............................................................33