Home

Messaging User Guide - for use with JBoss

image

Contents

1. ssssseee 43 5 11 Configuring the Remoting Connector ssssssssssenee me meme ene rennen 46 5 12 ServiceBindingManagger ssssssssssssssseem m ee enne nene hne nnn nnns nnne rne nnns nns 49 5 13 Message Driven Beans sirasi etes er etudes tes wb eeu ze a tu eb eve dee E TE vea 49 6 Clustering Notes 53 6 1 Unique Server Peer ID ii od eet f te e lt Ed e e edt beide fn 53 6 2 Clustered Destinations ie e D LO b E n ee Le tiu 53 6 3 Clustered Durable Subscriptions ssssssssssee eene 53 6 4 Clustered Temporary Destinations ssssssssseee emnes 53 6 5 Noneclustered Servers coe ae ee CO avin oe e o fe tee 53 6 6 Message Ordering in the Cluster ssssssssssssse meme nere renes 54 6 7 Idempotent Operations cece eee e eee eect ceca eee e eee canteen ee eae enirn nnne snis rsen nnne nnne 54 6 8 Clustered Connection Factories 2 0 eee eee tte eee emen 54 7 JBoss Messaging XA Recovery Configuration 55 8 JBoss Messaging Message Bridge Configuration 57 8 1 Message Bridge Overview osia enirere iok karain an eee mme meme nemen nennen 57 Messaging User Guide 8 2 Bridge deployment eii nti ERR seen EUER ERU ig ER RYE SEHR ataia 58 8 3 Bridge GonflguratlOn o1 it feet e d HR EE E ede TE eue tb e s Oed adf 58 9 Enabling JBoss Messaging Ordering Group 63 9 1 Acknowledge Mechanism 0 ccceececeeeee eee seen eee
2. 64 Notes and Limitations Once configured to enable the ordering group feature on a connection factory all messages that are sent from any producers created from the connection factory become ordering group messages The following factory service configuration file sample demonstrates how to enable the ordering group feature mbean code org jboss jms server connectionfactory ConnectionFactory name jboss messaging connectionfactory service ConnectionFactory xmbean dd z xmdesc ConnectionFactory xmbean xml depends optional attribute name ServerPeer gt jboss messaging service ServerPeer lt depends gt depends optional attribute name Connector gt jboss messaging service Connector transport bisocket lt depends gt lt depends gt jboss messaging service PostOffice lt depends gt attribute name JNDIBindings gt lt bindings gt lt binding gt MyConnectionFactory lt binding gt lt binding gt XAConnectionFactory lt binding gt lt binding gt java MyConnectionFactory lt binding gt lt binding gt java XAConnectionFactory lt binding gt lt bindings gt lt attribute gt lt The two OrderingGroup properties gt lt attribute name EnableOrderingGroup gt true lt attribute gt lt attribute name DefaultOrderingGroupName gt MyOrderingGroup lt attribute gt lt mbean gt The advantage of enabling the ordering group feature by making configuration changes is the ease with
3. To insert a special character into a gedit file choose Applications Accessories Character Map from the main menu bar Next choose Search Find from the Character Map menu bar type the name of the character in the Search field and click Next The character you sought will be highlighted in the Character Table Double click this highlighted character to place it in the Text to copy field and then click the Copy button Now switch back to your document and choose Edit Paste from the gedit menu bar The above text includes application names system wide menu names and items application specific menu names and buttons and text found within a GUI interface all presented in proportional bold and all distinguishable by context Mono spaced Bold ItalicorProportional Bold Italic Whether mono spaced bold or proportional bold the addition of italics indicates replaceable or variable text Italics denotes text you do not input literally or displayed text that changes depending on circumstance For example To connect to a remote machine using ssh type ssh username domain name at a shell prompt If the remote machine is example com and your username on that machine is john type ssh john example com The mount o remount file system command remounts the named file System For example to remount the home file system the command is mount o remount home To see the version of a currently installed package use the rpm q
4. is a trademark of Silicon Graphics International Corp or its subsidiaries in the United States and or other countries MySQLO is a registered trademark of MySQL AB in the United States the European Union and other countries All other trademarks are the property of their respective owners A guide to using JBoss Messaging 1 4 with the JBoss Enterprise Application Platform 5 and its patch releases Preface V T DOCUMENT Conventl ris diced deed tet e eive teo d det ved t d n ded voe Od dee vedete depen V 1 1 Typographic Conventions iiien in iani aiaiai n iaa inerte thesi nnne nennen V 1 2 Pull quote Conventions o rer Pre Pune te t leere ean et vi 1 3 Notes and Warnings iaei iraniana piadina mene mne nemen ren hrs enidan vii 2 Getting Help and Giving Feedback sssssssssseeeee mene nennen rennen vii 2 1 D0 You Need Help ied eee eR ge ees ine tak d emet ana vii 22 GVE us Eeedback ni scie al esie lalate tetas ae Pate actis viii 1 About JBoss Messaging 1 4 1 2 Introduction 3 2 1 JBoss Messaging FeatUres treie aia reaa narani aet eed eere ine Ra aa aA aaia 3 2 2 Compatibility with JBoss MQ sssssseee emen nnne eee nnne nnne nnne 4 2 3 System Properties used by JBoss Messaging sssssssssee ee 5 2 53 12 s pportbytesld rne Poe Pe eere a eet Vara Pe aia 5 2 3 2 Tetam oldxabellavIOUr siis t EAE ATAA be re Ten s REGE Eti edt 5 3 JBoss Messaging Installatio
5. Specifies whether messages are stored and read with a JDBC binary stream instead of via getBytes and setBytes Set this value to false if your database must use getBytes and setBytes The default value is true UsingTrailingByte Specifies how Sybase database BLOBs containing trailing zeroes are handled When set to true a trailing non zero byte is added to each BLOB before persistence and removed from the BLOB following persistence preventing truncation by the database The default value is false Certain versions of Sybase truncate a BLOB with trailing zeros This attribute is only required if you are running a Sybase database SupportsBlobOnSelect Specifies how BLOBs are inserted into certain database types When set to false two stage insertion will be used The default value is true 31 Chapter 5 Configuration Certain databases specifically Oracle do not allow BLOB insertion via an INSERT INTO SELECT FROM statement and require two stage conditional message insertion Set this attribute to false if you are running an Oracle database or other database with this requirement SQLProperties Specifies the DDL and DML for a particular database If a particular DDL or DML statement is not overridden the default Hypersonic configuration will be used for that statement UseNDBFailoverStrategy Specifies whether a SQL statement is re executed in the event a database transation commit
6. 2000 down thread false up thread false num initial members 3 MERGE2 max interval 100000 down thread false up thread false min interval 20000 FD SOCK down thread false up thread false FD timeout 10000 max tries 5 down thread false up thread false shun true gt VERIFY SUSPECT timeout 1500 down thread false up thread false pbcast NAKACK max xmit size 60000 use mcast xmit false gc_lag 0 retransmit_timeout 300 600 1200 2400 4800 down_thread false up_thread false discard_delivered_msgs true gt lt UNICAST timeout 300 600 1200 2400 3600 down thread false up thread false pbcast STABLE stability delay 1000 desired avg gossip 50000 down thread z false up_thread false max bytes 400000 pbcast GMS print local addr true join timeout 3000 use flush true flush timeout 3000 down thread z false up_thread false Chapter 5 Configuration join_retry_timeout 2000 shun false view_bundling true gt lt FRAG2 frag_size 60000 down_thread false up thread false lt pbcast STATE_TRANSFER down_thread false up_thread false use_flush true flush_timeout 3000 gt lt pbcast FLUSH down_thread false up_thread false timeout 20000 auto_flush_conf false gt lt config gt lt attribute gt lt mbean gt 5 5 1 MessagingPostOffice Attributes MessagingPostOf fice Service Attributes are described in t
7. Persistence Manager JBoss Messaging ships with a JDBC Persistence Manager which handles message data persistence in a relational database accessed via JDBC The Persistence Manager can be plugged into the Messaging server which allows additional implementations to persist message data in non relational stores and file stores Persistent service configuration details are grouped in database type gt persistence service xml JBoss Messaging ships with the hsq1db persistence service xml file by 27 Chapter 5 Configuration default which configures the Messaging server to use the Hypersonic database instance included by default with any JBoss Enterprise Application Server instance Hypersonic is not supported for use in a production environment JBoss Messaging also ships with Persistence Manager configurations for MySQL Oracle PostgreSQL Sybase Microsoft SQL Server and DB2 The example configuration files such as mysql persistence service xml and ndb persistence service xml are available from the jboss as docs examples jms directory of the release bundle The JDBC Persistence Manager uses standard SQL as its Data Manipulation Language DML so writing a Persistence Manager configuration for another database type is a matter of changing the configuration s Data Definition Language DDL which usually differs on a per database basis JBoss Messaging also ships with a Null Persistence Manager configuration option which can
8. Section 5 5 1 MessagingPostOffice Attributes for further information JBoss Messaging balances messages between nodes and caters for consumers of varying speeds so processing load can be efficiently distributed across the cluster To disable message redistribution between nodes while retaining other characteristics of clustered destinations do not specify the ClusterPullConnectionFactoryName attribute on the Server Peer Refer to Section 5 2 ServerPeer attributes for full details about this attribute 6 3 Clustered Durable Subscriptions JBoss Messaging durable subscriptions can be clustered in a way that allows multiple subscribers on multiple nodes to consume from one durable subscription A durable subscription is clustered automatically providing its topic is clustered For more information about configuring clustered topics and queues refer to the Clustered attribute in Section 5 5 1 MessagingPostOffice Attributes 6 4 Clustered Temporary Destinations JBoss Messaging supports clustering of temporary topics and queues All temporary topics and queues will be clustered if the Post Office is clustered For more information about configuring clustered topics and queues refer to the Clustered attribute in Section 5 5 1 MessagingPostOffice Attributes 6 5 Non clustered Servers Set the PostOffice clustered attribute to false if you do not want all nodes to participate in a cluster or if you do not want the server to
9. This contains the JGroups stack configuration for the control channel The control channel is used for sending request receiving responses from other nodes in the cluster The details of the JGroups configuration won t be discussed here since it is standard JGroups configuration Detailed information on JGroups can be found in JGroups release documentation or on line at http www jgroups org or http wiki jboss org wiki Wiki jsp page JGroups DataChannelConfig JBoss Messaging uses JGroups for all group management This contains the JGroups stack configuration for the data channel The data channel is used for sending sending receiving messages from other nodes in the cluster and for replicating session data The details of the JGroups configuration won t be discussed here since it is standard JGroups configuration Detailed information on JGroups can be found in JGroups release documentation or on line at http www jgroups org or http wiki jboss org wiki Wiki jsp page JGroups Database Connection Retry Parameters control whether a connection should be re established when a connection failure is detected how many attempts to reconnect should be made and at what interval each attempt should be made 25 Chapter 5 Configuration RetryOnConnectionFailure Specifies whether the MBean should attempt to reconnect to the database The default is false MaxRetry Specifies the maximum limit for DataSource connection failures The
10. USER_ID VARCHAR 32 NOT NULL PASSWD VARCHAR 32 NOT NULL CLIENTID VARCHAR 128 PRIMARY KEY USER_ID ENGINE INNODB JMSUserManager MBean Attributes CREATE_ROLE_TABLE CREATE TABLE JBM_ROLE ROLE_ID VARCHAR 32 NOT NULL USER ID VARCHAR 32 NOT NULL PRIMARY KEY USER ID ROLE ID ENGINE INNODB SELECT PRECONF CLIENTID SELECT CLIENTID FROM JBM USER WHERE USER ID POPULATE TABLES 1 INSERT INTO JBM USER USER ID PASSWD CLIENTID VALUES jdoe jdoepw jdoe id attribute lt mbean gt 5 8 1 JMSUserManager MBean Attributes Create TablesOnStartup Set this to true if you wish the JMS user manager to attempt to create the tables and indexes when it starts If the tables or indexes already exist a SQLException will be thrown by the JDBC driver and ignored by the Persistence Manager allowing it to continue By default the value of CreateTablesOnStartup attribute is set to true UsingBatchUpdates Set this to true if the database supports JDBC batch updates The JDBC Persistence Manager will then group multiple database updates in batches to aid performance By default the value of UsingBatchUpdates attribute is set to false SQLProperties This is where the DDL and DML for the particular database is specified If a particular DDL or DML statement is not overridden the default Hypersonic configuration will be used for that statement Default user and role data can also be specified here Any data to be inserted mus
11. as channel size increases The individual parameters associated with pageable channels are as follows FullSize Specifies the maximum number of messages held by the queue or topic subscription in memory at any one time The actual queue can hold more messages but these are paged to and from storage as messages are added or consumed If no value is specified the default is 75000 PageSize Specifies the maximum number of messages that are pre loaded per operation when loading messages from the queue or subscription If no value is specified the default is 2000 DownCacheSize Specifies the maximum number of messages the Down Cache holds before the messages are flushed to storage The default value is 2000 messages When messages are paged to storage from the queue they enter a Down Cache before being written to storage This enables the write to occur as a single operation which aids performance Paging parameters for temporary queues must be specified on the appropriate connection factory Refer to Section 5 10 Configuring Connection Factories for detailed information about the different connection factories available 5 9 2 1 3 Queue Managed Bean Operations RemoveAllMessages Removes and deletes all messages from the queue 37 Chapter 5 Configuration Sop important This will permanently delete all messages from the queue use this operation with caution ListAllMessages Lists all messages currently in
12. fails in a clustered environment If set to true the SQL statement is re executed in the event that the commit fails If a further error occurs the persistence manager assumes the error is due to the previous transaction having committed successfully and ignores the error By default this attribute is set to false When some databases such as MySQL run in clustered environments they can fail during database transaction commits If this occurs the final transaction state is unknown MaxParams Specifies the maximum number of parameters allowed per prepared statement while loading messages The default value is 500 5 8 Configuring the JMS user manager The JMS User Manager maps pre configured client IDs to users It also manages user and role tables depending on the configured login module The following is an example JMSUserManager configuration r mbean code org jboss jms server plugin JDBCJMSUserManagerService 32 name z jboss messaging service JMSUserManager xmbean dd xmdesc JMSUserManager xmbean xm1 lt depends gt jboss jca service DataSourceBinding name DefaultDS lt depends gt depends optional attribute name TransactionManager gt jboss service TransactionManager lt depends gt attribute name DataSource gt java DefaultDS lt attribute gt lt attribute name CreateTablesOnStartup gt true lt attribute gt lt attribute name SqlProperties gt CREATE_USER_TABLE CREATE TABLE JBM_USER
13. from you Submit a report in Bugzilla against the product JBoss Enterprise Application Platform 5 and the component doc JBoss Messaging User Guide The following link will take you to a pre filled bug report for this product http bugzilla redhat com Fill out the following template in Bugzilla s Description field Be as specific as possible when describing the issue this will help ensure that we can fix it quickly Document URL Section Number and Name Describe the issue Suggestions for improvement Additional information Be sure to give us your name so that you can receive full credit for reporting the issue https bugzilla redhat com enter_bug cgi product JBoss 20Enterprise 20Application 20Platform 205 amp component doc JBoss_Messaging_User_Guide amp version 5 1 2 amp short_desc Bug 20in 20JBoss 20Messaging 20User 20Guide viii Chapter 1 About JBoss Messaging 1 4 JBoss Messaging is an enterprise messaging system from JBoss It is a complete rewrite of JBossMQ the legacy JBoss Java Message Service JMS provider JBoss Messaging is the default JMS provider in JBoss Enterprise Application Platform 4 3 and 5 JBoss Messaging is integral to Red Hat s messaging strategy It offers improvements to performance in both single node and clustered environments and features a modular architecture so that we can easily add more features in the future This guide shows you how to install set up and configure JBos
14. of ACKNOWLEDGE acknowledgement when not using transacted jms valid values AUTO _ ACKNOWLEDGE or DUPS_OK_ ACKNOWLEDGE clientID java lang String The client id of the connection subscriptionDurability String NonDurable Whether topic subscriptions are durable Valid values are Durable or NonDurable subscriptionName The subscription name of the topic subscription Sop important MDB properties listed in Table 5 2 WDB Properties Provided as JBoss Extensions are not mandatory unless explicitly called out in the Remarks column 50 Message Driven Beans Table 5 2 MDB Properties Provided as JBoss Extensions Name isTopic Type boolean Default value false Remarks Sets the destinationType providerAdapterJNDI user java lang String java lang String DefaultJMSProvider none The JNDI name of the JMS provider The user ID used to connect to the JMS server pass maxMessages java lang String int none The password of the user Read this number of messages before delivering messages to the MDB Each message is delivered individually on the same thread in an attempt to avoid context excessive context switching minSession int The minimum number of JMS sessions that are available to concurrently deliver messages to this mdb maxSession int 15 The maximum number of JMS sessions that are availa
15. ordering group API to deliver strictly ordered messages regardless of their priorities Clustered Examples Sy important The clustered examples require two running JBoss Application Server instances with port settings set to ports 01 and ports 02 The examples are supported for use on the Enterprise Application Platform A11 and Production server profiles The readme html for each example provides the setup details expected output and simple troubleshooting distributed topic This example demonstrates a JMS client interacting with a JBoss Messaging distributed topic it requires two JBoss AS instances to be running distributed queue This example demonstrates a JMS client interacting with a JBoss Messaging distributed queue it requires two JBoss AS instances to be running queue failover This example demonstrates the transparent failover of a JMS consumer 11 12 Chapter 5 Configuration The Java Message Service JMS API specifies how a messaging client interacts with a messaging server How messaging services such as message destinations and connection factories are defined and implemented depends on the JMS provider JBoss Messaging has its own files for service configuration This chapter shows you how to configure various services available in JBoss Messaging that work together to provide JMS API level services to client applications JBoss Messaging configuration is divided between
16. package command It will return a result as follows package version release Note the words in bold italics above username domain name file system package version and release Each word is a placeholder either for text you enter when issuing a command or for text displayed by the system Aside from standard usage for presenting the title of a work italics denotes the first use of a new and important term For example Publican is a DocBook publishing system 1 2 Pull quote Conventions Terminal output and source code listings are set off visually from the surrounding text Output sent to a terminal is set in mono spaced roman and presented thus books Desktop documentation drafts mss photos stuff svn books tests Desktop1 downloads images notes scripts svgs Source code listings are also set in mono spaced roman but add syntax highlighting as follows package org jboss book jca ex1 import javax naming InitialContext vi Notes and Warnings public class ExClient public static void main String args throws Exception InitialContext iniCtx new InitialContext Object ref iniCtx lookup EchoBean EchoHome home EchoHome ref Echo echo home create System out println Created Echo System out println Echo echo Hello echo echo Hello 1 3 Notes and Warnings Finally we use three visual styles to draw attention to information that might otherwise be overlooked No
17. several configuration files Depending on the type of service provided configuration information is divided between messaging service xml remoting bisocket service xml your database type gt persistence service xml connection factories service xml and destinations service xml These files can all be found in the JBOSS_HOME server PROFILE deploy messaging directory AOP interceptor stacks can be configured in aop messaging client xm1 for client side behavior and aop messaging server xml for server side behavior There is usually no need to change these files but some interceptors can be removed to improve performance if they are not required Ensure that you have considered the security implications before removing the security interceptor 5 1 Configuring the ServerPeer The ServerPeer is the heart of the JBoss Messaging JMS facade You can configure its behavior by altering JBOSS_HOME server PROFILE deploy messaging messaging service xml All JBoss Messaging services are based in the ServerPeer An example of a Server Peer configuration is presented below Note that not all values for the server peer s attributes are specified in the example lt ServerPeer MBean configuration E mbean code org jboss jms server ServerPeer name jboss messaging service ServerPeer xmbean ddz xmdesc ServerPeer xmbean xm1 lt The unique id of the server peer in a cluster each node MUST have a unique value
18. the ServerPeer for a full overview of the supported parameters and operations KeepOldFailoverMode Specifies whether the timestamp table failover mode should be used The default is true disable new failover behavior NodeStateRefreshlInterval Specifies the maximum duration in milliseconds a cluster will wait for a node to refresh its timestamp before the cluster marks the node as disabled The default is 30000 30 seconds 5 6 Configure the MessagingClusterHealthMBean The MessagingPostOf fice uses the KeepOldFailoverMode and NodeStateRefreshInterval parameters to control the duration a node must update timestamps to 26 Configuring the Persistence Manager remain part of a cluster These parameters do not control how a node responds to losing connection to the database If a node loses connection to the database it can not update the timestamp information available to the MessagePostOf fice Even though the node may still be healthy the cluster has no way of determining the actual state of the node As a result the cluster assumes the node has failed and duplicate message delivery can occur The MessagingClusterHealthMBean MBean is responsible for monitoring the node state and stopping and starting a node when it loses connection to the database When a node is shunned from the cluster and subsequently loses database connectivity the MBean shuts down the node immediately The MBean monitors the JGroups status and databas
19. the queue Using a JMS selector as an argument in this operation lets you retrieve a subset of the messages in the queue that match the given criteria ListDurableMessages Lists all durable messages in the queue Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the given criteria ListNonDurableMessages Lists all non durable messages in a queue Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the given criteria ResetMessageCounter Resets the message counter to zero ResetMessageCounterHistory Resets the message counter history ListMessageCounterAsHTML Lists the message counter in HTML format ListMessageCounterHistoryAsHTML Lists the message counter history in HTML format 5 9 3 Configuring Topics 5 9 3 1 Topic Managed Bean Attributes Name Defines the name of the topic JNDIName Defines the JNDI location where the topic is bound DLQ Defines the Dead Letter Queue DLQ used for this topic and overrides any value set in the Server Peer configuration file ExpiryQueue Defines the expiry queue used for this topic and overrides any value set in the Server Peer configuration file RedeliveryDelay Defines the delay period between redelivery attempts for this topic and overrides any value set in the Server Peer configuration file 38 Configuring Topics MaxDeliveryAttempts De
20. the secondary ServerSocket is bound To work behind a firewall you may need to specify a particular value for your firewall configuration secondaryConnectPort The port that the client uses to connect Specify this to let your client work with NAT routers maxPoolSize The number of threads used on the server side to service requests By default JBoss Messaging binds to jboss bind address which can be defined by running the run sh c yourconfig b yourIP command If necessary you can change remoting bisocket service xml to use a different communication port 48 ServiceBindingManager Ab Warning Do not change values in the connector configuration other than those listed above Changing other values can cause JBoss Messaging to stop functioning correctly 5 12 ServiceBindingManager The SeviceBindingManager provides multiple application server instances running on the same IP using different port ranges which is useful during development There are other ways to do this but the ServiceBindingManager removes much hassle 5 13 Message Driven Beans A message driven bean is an enterprise bean that allows J2EE applications to process messages asynchronously It acts as a JMS message listener which is similar to an event listener except that it receives messages instead of events The messages may be sent by any J2EE component an application client another enterprise bean or a Web component or by a JMS applic
21. up_thread false min_interval 20000 gt FD SOCK down thread false up thread false VERIFY SUSPECT timeout 1500 down thread false up thread false pbcast NAKACK max xmit size 60000 use mcast xmit false gc_lag 0 retransmit_timeout 300 600 1200 2400 4800 down_thread false up_thread false discard_delivered_msgs true gt lt pbcast STABLE stability_delay 1000 desired_avg_gossip 50000 down_thread false up_thread false max_bytes 400000 gt lt pbcast GMS print_local_addr true join_timeout 3000 down_thread false up_thread false join_retry_timeout 2000 shun false view_bundling true gt lt config gt lt attribute gt lt JGroups stack configuration to use for the control channel used for control messages gt lt We use udp stack for the control channel gt lt attribute name ControlChannelConfig gt lt config gt lt UDP mcast_addr jboss messaging controlchanneludpaddress 228 7 7 7 mcast_port jboss messaging controlchanneludpport 45568 tos 8 ucast_recv_buf_size 20000000 ucast_send_buf_size 640000 mcast_recv_buf_size 25000000 mcast_send_buf_size 640000 loopback false discard incompatible packets true max bundle size 64000 max bundle timeout 30 use incoming packet handler true use outgoing packet handler false alfo geritis m down thread false up_thread false enable bundling false PING timeout
22. which message ordering functionality can be achieved without the need for code changes 9 3 Notes and Limitations The following points should be noted in regard to ordering group functionality Queues must be used with the ordering group feature The feature will not work with topics The ordering group feature should not be used in conjunction with message selectors and scheduled delivery A message is considered completed and the next message will be available for delivery if the original message is dead or has expired A dead message is moved to the DLQ whereas an expired message is moved to the ExpiryQueue e When using a ConnectionConsumer the ordering of the messages will be observed However the ConnectionConsumer does not control which session will receive the next message 65 Chapter 9 Enabling JBoss Messaging Ordering Group The ordering group feature does not work with clustered queues However if the user deploys the clustered queue as HASingleton which means at a time only one queue of a clustered queue is active ordering groups work as expected 66 Appendix A Revision History Revision Thu 8 December 2011 Russell Dickenson 5 1 2 100 rdickens at redhat dot com Incorporated changes for JBoss Enterprise Application Platform 5 1 2 GA For information about documentation changes to this guide refer to Release Notes 5 1 2 67 68
23. 00 lt attribute gt lt attribute name failureDisconnectTimeout isParam true gt 0 lt attribute gt lt attribute name callbackErrorsAllowed gt 1 lt attribute gt lt attribute name registerCallbackListener gt false lt attribute gt lt attribute name useClientConnectionIdentity isParam true gt true lt attribute gt lt attribute name timeout isParam true gt 0 lt attribute gt lt Max Number of connections in client pool This should be significantly higher than the max number of sessions consumers you expect gt lt attribute name JBM_clientMaxPoolSize isParam true gt 200 lt attribute gt lt The maximum time to wait before timing out on trying to write a message to socket for delivery gt attribute name callbackTimeout gt 10000 lt attribute gt lt Use these parameters to specify values for binding and connecting control connections to work with your firewall NAT configuration lt attribute name secondaryBindPort gt xyz lt attribute gt lt attribute name secondaryConnectPort gt abc lt attribute gt a gt lt invoker gt lt handlers gt lt handler subsystem JMS gt org jboss jms server remoting JMSServerInvocationHandler lt handler gt lt handlers gt 47 Chapter 5 Configuration lt config gt lt attribute gt lt mbean gt lt server gt There are restricted attributes that should not be changed unless you are absolutely confident you un
24. If true then the message ID of the message before bridging will be added as a header to the message so it is available to the receiver Can then be sent as correlation ID to correlate ina distributed request response gt lt attribute name AddMessageIDInHeader gt false lt attribute gt lt mbean gt 59 Chapter 8 JBoss Messaging Message Bridge Configuration Message Bridge Configuration Attributes SourceProviderLoader TargetProvider Loader The JMSProviderLoader managed bean is used by the bridge to look up the source connection factory and source destination By default JBoss Enterprise Application Platform ships with one JMSProviderLoader which is deployed in the JBOSS_HOME server PROFILE deploy messaging jms ds xml file and serves as the default local JHSProviderLoader Fora clustered configuration hajndi jms ds xml performs the same role If your source or target destination is on a different server or corresponds to a non JBoss JMS Provider you can deploy another JMSProviderLoader managed bean instance that the bridge can use to contact the destination on the remote JMS Provider To use QOS ONCE AND ONLY ONCE delivery with a remote non JBoss Messaging source or target the remote JMS Provider must provide a fully functional JMS XA resource implementation that works remotely from the server SourceDestinationLookup The full JNDI lookup for the source destination via the SourceProviderLoader such as qu
25. JBoss Enterprise Application Platform 5 Messaging User Guide for use with JBoss Enterprise Application Platform 5 e e JBoss e by Red Hat Tim Fox Jeff Mesnil Andy Taylor Clebert Suconic Howard Gao Messaging User Guide JBoss Enterprise Application Platform 5 Messaging User Guide for use with JBoss Enterprise Application Platform 5 Edition 5 1 2 Author Tim Fox Author Jeff Mesnil Author Andy Taylor Author Clebert Suconic Author Howard Gao Editor Laura Bailey Editor Jared Morgan Copyright 2011 Red Hat Inc The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution Share Alike 3 0 Unported license CC BY SA An explanation of CC BY SA is available at http creativecommons org licenses by sa 3 0 In accordance with CC BY SA if you distribute this document or an adaptation of it you must provide the URL for the original version Red Hat as the licensor of this document waives the right to enforce and agrees not to assert Section 4d of CC BY SA to the fullest extent permitted by applicable law Red Hat Red Hat Enterprise Linux the Shadowman logo JBoss MetaMatrix Fedora the Infinity Logo and RHCE are trademarks of Red Hat Inc registered in the United States and other countries Linux is the registered trademark of Linus Torvalds in the United States and other countries Java is a registered trademark of Oracle and or its affiliates XFS
26. JMS implementation shipped with Enterprise Application Platform 4 2 Since JBoss Messaging is compatible with both JMS 1 1 and JMS 1 0 2b the JMS code written against JBoss MQ will run with JBoss Messaging without any further changes JBoss Messaging has no wire format compatibility with JBoss MQ It is therefore necessary to upgrade JBoss MQ clients with JBoss Messaging client JARs System Properties used by JBoss Messaging Sop important Although JBoss Messaging deployment descriptors are similar to JBoss MQ deployment descriptors they are not identical and will require some simple adjustments before they will work with JBoss Messaging The database data model is completely different so JBoss Messaging should not be used with a JBoss MQ data schema or vice versa 2 3 System Properties used by JBoss Messaging 2 3 1 support bytesld This system property controls the default behavior when constructing a JBossMessage object froma foreign message object Set this property via the command line on server startup with the D option If this property is set to true the JBossMessage constructor will try to extract the native byte correlation ID from the foreign message headers If set to false it will use the normal string type JMSCorrelationID This property will default to true if not set or when set to something other than true or false 2 3 2 retain oldxabehaviour This system property controls the type of except
27. Peer configuration file RedeliveryDelay Defines the redelivery delay to be applied to this queue and overrides any value set in the Server Peer configuration file MaxDeliveryAttempts Defines the maximum number of times message delivery is attempted before the message is sent to the DLQ if configured The default value 1 means that the value from the Server Peer configuration file is used Any other setting will override the value set in the Server Peer configuration file CreatedProgrammatically Returns true if the queue was created programmatically MessageCount Returns the total number of messages in the queue That is the number of messages being scheduled plus the number being delivered plus the number not being delivered ScheduledMessageCount Returns the number of scheduled messages in the queue This is the number of messages scheduled to be delivered at a later date Scheduled delivery lets you specify the earliest time at which a particular message will be delivered For example you can send a message now and specify that it will not be delivered for two hours To do so set the following in the message header long now System currentTimeMillis Message msg sess createMessage msg setLongProperty JBossMessage JMS JBOSS SCHEDULED DELIVERY PROP NAME now 1000 60 60 2 prod send msg 35 Chapter 5 Configuration MaxSize Specifies the maximum number of messages that can be held in a queu
28. Server if TEXTSIZE value is set to a lesser value than the default value For further information refer to hitps issues jboss org browse SOA 554 and the Special Notes on Sybase section in the Administration and Configuration Guide Sp important Microsoft SQL Server does not automatically unallocate hard drive space when data is deleted from a database When the hard drive database space is used as a data store for a service that temporarily stores many records Such as a messaging service the disk space will quickly become much greater than the amount of data actually being stored Database administrators must implement database maintenance plans to ensure that the unused space is reclaimed Refer to your Microsoft SQL Server documentation for the DBCC commands ShrinkDatabase and UpdateUsage for guidance reclaiming the unused space For further information about this issue refer to https issues jboss org browse SOA 629 5 7 1 JDBCPersistenceManager MBean Attributes The JDBCPersistenceManager attributes are described in the following list CreateTablesOnStartup Set this to true if you wish the Persistence Manager to attempt to create the tables and indexes when it starts If the tables or indexes already exist a SQLException will be thrown by the JDBC driver and ignored by the Persistence Manager allowing it to continue By default the value of CreateTablesOnStartup attribute is set to true UsingBatchUpdates S
29. ame RecoverDeliveriesTimeout gt 300000 lt attribute gt lt Set to true to enable message counters that can be viewed via JMX gt lt attribute name EnableMessageCounters gt false lt attribute gt 14 ServerPeer attributes lt The password used by the message sucker connections to create connections THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM attribute name SuckerPassword gt lt attribute gt gt lt The name of the server aspects configuration resource lt attribute name ServerAopConfig gt aop jboss aop messaging server xml lt attribute gt gt lt The name of the client aspects configuration resource lt attribute name ClientAopConfig gt aop jboss aop messaging client xml lt attribute gt E depends optional attribute name PersistenceManager gt jboss messaging service PersistenceManager lt depends gt depends optional attribute name JMSUserManager gt jboss messaging service JMSUserManager lt depends gt lt depends gt jboss messaging service Connector transport bisocket lt depends gt lt depends optional attribute name SecurityStore proxy type org jboss jms server SecurityStore gt jboss messaging service SecurityStore lt depends gt lt mbean gt 5 2 ServerPeer attributes This section discusses the ServerPeer managed bean attributes StopServerPeerOnDBFailure When set to true the server will stop if a database error occ
30. arget connection attribute name TargetPassword gt MaryS3cur3 lt attribute gt gt lt Optional The Quality Of Service mode to use one of QOS_AT_MOST_ONCE 0 QOS_DUPLICATES_OK 1 QOS ONCE AND ONLY ONCE 2 gt attribute name QualityOfServiceMode gt 0 lt attribute gt lt JMS selector to use for consuming messages from the source lt attribute name Selector gt specify jms selector here lt attribute gt gt lt The maximum number of messages to consume from the source before sending to the target E attribute name MaxBatchSize gt 5 lt attribute gt lt The maximum time to wait in ms before sending a batch to the target even if MaxBatchSize is not exceeded 1 means wait forever gt lt attribute name MaxBatchTime gt 1 lt attribute gt lt If consuming from a durable subscription this is the subscription name lt attribute name SubName gt mysub lt attribute gt If consuming from a durable subscription this is the client ID to use attribute name ClientID gt myClientID lt attribute gt lt The number of ms to wait between connection retrues in the event connections to source or target fail s gt lt attribute name FailureRetryInterval gt 5000 lt attribute gt lt The maximum number of connection retries to make in case of failure before giving up 1 means try forever gt lt attribute name MaxRetries gt 1 lt attribute gt lt
31. ation Example 5 2 Bisocket Remoting Configuration lt xml version 1 0 encoding UTF 8 gt ceps Standard bisocket based Remoting service deployment descriptor Id remoting bisocket service xml 3981 2008 03 28 18 00 41Z timfox lt server gt lt Standard bisocket connector the bisocket transport only opens connection from client gt server so can be used with firewalls where only outgoing connections are allowed For examples of HTTP and SSL transports see docs examples gt lt mbean code org jboss remoting transport Connector name jboss messaging service Connector transport bisocket display name Bisocket Transport Connector gt lt attribute name Configuration gt lt config gt lt invoker transport bisocket gt lt There should be no reason to change these parameters warning Changing them may stop JBoss Messaging working correctly gt lt attribute name marshaller isParam true org jboss jms wireformat JMSWireFormat attribute attribute name unmarshaller isParam true org jboss jms wireformat JMSWireFormat attribute attribute name dataType isParam true gt jms lt attribute gt 46 Configuring the Remoting Connector lt attribute name socket check_connection isParam true gt false lt attribute gt attribute name sServerBindAddress gt jboss bind address lt attribute gt attribute name sServerBindPort gt jboss messaging connector bisock
32. ation Guide The default configuration includes one remoting connector which is used by the single default connection factory Each connection factory can be configured to use a different connector The default connector is configured to use the remoting bisocket transport a TCP socket based transport that listens and accepts connections only on the server side That is connections are always initiated from the client side This connector is ideal for typical firewall scenarios where only inbound connections are allowed on the server or where only outbound connections are allowed from the client The bisocket transport can be configured to use SSL when a higher level of security is required The other supported transport is the HTTP transport which uses the Hypertext Transfer Protocol to communicate between client and server The client periodically polls the server for messages to receive data This transport is ideal when a firewall between server and client allows only incoming HTTP traffic on the server Because of its polling behavior and the limitations of HTTP this transport does not perform as well as the bisocket transport It is not designed to handle high load situations No other remoting transports are currently supported by JBoss Messaging Remoting configuration details can be seen in JBOSS_HOME server SERVER deploy messaging remoting bisocket service xml The following code is an example of a bisocket remoting configur
33. ation or system that does not use J2EE technology This definition is from http ava sun com j2ee tutorial 1_3 fcs doc EJBConcepts5 htm and you can read more about message driven beans MDB from there You can specify MDBs in a deployment descriptor or using annotations Using a descriptor lt enterprise beans gt lt message driven gt lt ejb name gt MDBExample lt ejb name gt lt destination jndi name gt queue QUEUE_NAME lt destination jndi name gt lt message driven gt lt enterprise beans gt Using an annotation MessageDriven mappedName jms Queue public class SimpleMessageBean implements MessageListener Resource private MessageDrivenContext mdc You configure MDBs using properties divided into those specified by the JCA specification and those available as JBoss extensions 49 Chapter 5 Configuration Sop important MDB properties listed in Table 5 1 WDB Properties Provided by the JCA Specification are not mandatory unless explicitly called out in the Remarks column Table 5 1 MDB Properties Provided by the JCA Specification Default value Remarks destination java lang String This property is Mandatory The JNDI name of the Queue or Topic destinationType java lang String The type of destination valid values are javax jms Queue or javax jms Topic messageSelector java lang String The message selector of the subscription acknowledgeMode int AUTO_ The type
34. base Section 5 7 Configuring the Persistence Manager and Section 8 1 Message Bridge Overview 6 8 Clustered Connection Factories When supportsLoadBalancing is set to true in the connection factory consecutive attempts to create connections will round robin between available servers The first node is chosen randomly When supportsFailover is set to true failover will occur transparently and automatically whenever any connection error is detected For more information about configuring connection factories refer to Section 5 10 1 ConnectionFactory Managed Bean Attributes 54 Chapter 7 JBoss Messaging XA Recovery Configuration This section describes how to configure JBoss Transactions to handle XA recovery for JBoss Messaging resources in JBoss Enterprise Application Platform The JBoss Transactions Recovery Manager can be configured to continually poll for and recover JBoss Messaging XA resources This provides a high level of transaction durability To enable JBoss Transactions Recovery Manager add a line to JBOSS_HOME server PROFILE conf jbossts properties xml The following code snippet includes the line required lt properties depends arjuna name jta gt bes Support subtransactions in the JTA layer Default is NO gt property name com arjuna ats jta supportSubtransactions value NO gt property name com arjuna ats jta jtaTMImplementation value com arjuna ats internal jta transac
35. be clustered For more information about configuring non clustered server refer to the various attributes in Section 5 5 1 MessagingPostOffice Attributes 53 Chapter 6 Clustering Notes 6 6 Message Ordering in the Cluster To ensure messages are consumed in the same order they were produced set strict JMS ordering by setting the DefaultPreserveOrdering Server Peer attribute to true While set to true messages cannot be distributed as freely around the cluster The default value is false 6 7 Idempotent Operations A message is guaranteed to be persisted when the message sent to a persistent destination returns with no exception An exception does not guarantee the message was not persisted because failure may have occurred between the message being persisted and a response being returned to the caller Applications must therefore be coded so that operations are idempotent that is operations can be repeated without causing the system to become inconsistent You can implement this behaviour on the application level by checking for duplicate messages and discarding them if the original message has been sent successfully This duplicate checking is a powerful technique that can remove the need for XA transactions JBoss Messaging is configured by default to perform duplicate checking in a clustered environment Persistence considerations are located in Section 5 3 ServerPeer methods Section 5 4 Changing the Data
36. be used when persistence is not required The following code is the default Hypersonic persistence manager configuration mbean code org jboss messaging core jmx JDBCPersistenceManagerService name jboss messaging service PersistenceManager xmbean dd xmdesc JDBCPersistenceManager xmbean xm1 gt lt depends gt jboss jca service DataSourceBinding name DefaultDS lt depends gt depends optional attribute name TransactionManager jboss service TransactionManager lt depends gt lt The datasource to use for the persistence manager gt attribute name DataSource gt java DefaultDS lt attribute gt lt If true will attempt to create tables and indexes on every start up gt lt attribute name CreateTablesOnStartup gt true lt attribute gt lt If true then will use JDBC batch updates gt lt attribute name UsingBatchUpdates gt false lt attribute gt lt The maximum number of parameters to include in a prepared statement gt lt attribute name MaxParams gt 500 lt attribute gt lt mbean gt 28 JDBCPersistenceManager MBean Attributes Sop important The maximum size of Sybase database text and image data types is set to 2 kilobytes by default Any message that exceeds this limit is truncated without any information or warning Set the TEXTSIZE database parameter to a higher value to prevent potential truncation Truncation may also occur in the Microsoft SQL
37. ble to concurrently deliver messages to this mdb reconnectinterval long 10 seconds The length of time in seconds between attempts to re connect to the JMS provider keepAlive long 60 seconds The length of time in milliseconds that sessions over the minimum are kept alive sessionTransacted useDLQ boolean boolean true true Whether the sessions are transacted Whether to use a Dead Letter Queue DLQ handler dLQJNDIName java lang String queue DLQ The JNDI name of the DLQ 51 Chapter 5 Configuration dLOHandler java lang String Default value org jboss resource adapter jms inflow dlq GenericDLOHandler Remarks The org jboss resource adapter jms inflow DLQHandler implementation class name dLQUser java lang String The user id used to make the dlq connection to the JMS server dLQPassword dLQClientID java lang String java lang String The password of the dLQUser The client id of the DLQ connection dLOMaxResent redeliverUnspecified transaction Timeout int boolean Default is the timeout set for the resource manager The maximum number of times a message is redelivered before it is sent to the DLQ Whether to attempt to redeliver a message in an unspecified transaction context Time in seconds for the transaction timeout DeliveryActive boolean Configuring de
38. by the connection factory The value must correspond to the name of a class that implements the interface org jboss jms client plugin LoadBalancingFactory The default value is org jboss jms client plugin RoundRobinLoadBalancingFactory which load balances connections across the cluster in a round robin fashion Connector Specifies the remoting connector used by the connection factory Different connection factories can use different connectors so you can deploy one connection factory that uses the HTTP transport to communicate with the server and another that uses the bisocket transport to communicate EnableOrderingGroup Specifies whether strict message ordering is enabled on the ConnectionFactory If set to true any messages sent from producers which are created from the enabled connection factory become ordering group messages The default value for this parameter is false DefaultOrderingGroupName Specifies the default name for the message ordering group The specified name will take effect once the EnableOrderingGroup parameter is set to true If this attribute is missing the group name will be generated automatically 45 Chapter 5 Configuration 5 11 Configuring the Remoting Connector JBoss Messaging uses JBoss Remoting for all communication between the client and the server For more information about JBoss Remoting configuration and capabilities refer to the Remoting chapter in the Administration and Configur
39. ctor attribute to specify the service name of the connector you wish to use mbean code org jboss jms server connectionfactory ConnectionFactory name jboss messaging connectionfactory service MyConnectionFactory xmbean dd z xmdesc ConnectionFactory xmbean xml depends optional attribute name ServerPeer gt jboss messaging service ServerPeer lt depends gt depends optional attribute name Connector gt jboss messaging service Connector transport bisocket lt depends gt lt depends gt jboss messaging service PostOffice lt depends gt lt attribute name JNDIBindings gt lt bindings gt lt binding gt MyConnectionFactory lt binding gt lt binding gt factories cf lt binding gt lt bindings gt lt attribute gt lt attribute name ClientID gt myClientID lt attribute gt attribute name SupportsFailover gt true lt attribute gt lt attribute name SupportsLoadBalancing gt false lt attribute gt attribute name LoadBalancingFactory gt org acme MyLoadBalancingFactory lt attribute gt lt attribute name PrefetchSize gt 1000 lt attribute gt lt attribute name SlowConsumers gt false lt attribute gt lt attribute name StrictTck gt true lt attribute gt lt attribute name SendAcksAsync gt false lt attribute gt attribute name DefaultTempQueueFullSize gt 50000 lt attribute gt lt attribute name DefaultTempQueuePageSize gt 1000 lt attribute gt lt attribute name DefaultTempQueueDo
40. d out for this configuration since not all attributes should be specified at once Example 8 1 Message Bridge Configuration lt mbean code org jboss jms server bridge BridgeService name jboss messaging service Bridge name TestBridge xmbean dd xmdesc Bridge xmbean xm1 gt lt The JMS provider loader that is used to lookup the source destination gt depends optional attribute name SourceProviderLoader gt jboss messaging service JMSProviderLoader name JMSProvider lt depends gt lt The JMS provider loader that is used to lookup the target destination gt depends optional attribute name TargetProviderLoader gt jboss messaging service JMSProviderLoader name JMSProvider lt depends gt lt The JNDI lookup for the source destination gt lt attribute name SourceDestinationLookup gt queue A lt attribute gt lt The JNDI lookup for the target destination gt lt attribute name TargetDestinationLookup gt queue B lt attribute gt lt The username to use for the source connection 58 Bridge Configuration lt attribute name SourceUsername gt bob lt attribute gt gt lt The password to use for the source connection lt attribute name SourcePassword gt BobSecur3 lt attribute gt gt lt The username to use for the target connection lt attribute name TargetUsername gt mary lt attribute gt gt lt The password to use for the t
41. dded or consumed If no value is specified the default is 75000 PageSize Specifies the maximum number of messages that are pre loaded per operation when loading messages from the queue or subscription If no value is specified the default is 2000 40 Configuring Topics DownCacheSize Specifies the maximum number of messages the Down Cache holds before the messages are flushed to storage The default value is 2000 messages When messages are paged to storage from the queue they enter a Down Cache before being written to storage This enables the write to occur as a single operation which aids performance Paging parameters for temporary queues must be specified on the appropriate connection factory See the section on Connection Factory Configuration for details 5 9 3 2 Topic Managed Bean Operations RemoveAllMessages Removes and deletes all messages from subscriptions that belong to this topic This will permanently delete all messages from the topic use this operation with caution ListAllMessages Lists all messages belonging to a specified subscription Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the given criteria ListDurableMessages Lists all durable messages belonging to the specified subscription Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the giv
42. default is 25 Set the parameter to 1 to activate retry forever mode This parameter is valid when RetryOnConnectionFailure is set to true Important Closing Clients Issue on Nodes with MaxRetry set to Clients that consume messages from a clustered destination can become unresponsive when closed This happens if the node has the value MaxRetry set to 1 and loses the connection to the database To avoid the problem set the node parameter MaxRetry to a value greater than 1 You can set the attribute value in the MBeans PersistenceManager PostOffice and JMSUserManager in the file database persistence service xml RetryInterval Specifies the retry interval between two consecutive retries The default is 1000 milliseconds This parameter is valid when RetryOnConnectionFailure is setto true If a node becomes unresponsive for a few seconds while still being stable for example during a minor network malfunction past failover behavior reported the node had left the cluster This scenario can be avoided by specifying the following parameters in the MessagePostOffice bean The following parameters provide the MessagePostOffice access to the cluster timestamp table which is used to more accurately determine the state of a node Sop important The timestamp table parameters should be used in conjunction with the MessagingClusterHealthMBean MBean You deploy this MBean in the ServerPeer MBean Refer to Section 5 1 Configuring
43. derstand the impact of the changes The following attributes are safe to change and configure to the requirements of your project clientLeasePeriod Clients periodically return heartbeats to the server to confirm that they are still active If the server does not receive a heartbeat after a certain period of time it will close down the connection and remove all resources that correspond to the client s session The clientLeasePeriod determines the period of time between heartbeats in milliseconds The default value is 10000 By default the server closes a client if it does not receive a heartbeat within double the clientLeasePeriod In reality the period is automatically resized according to system load numberOfRetries The number of seconds JBoss Remoting blocks on the client pool while waiting for a connection to become available If you have a very large number of sessions concurrently accessing the server from a client and cannot obtain connections from the pool you may want to increase this value clientMaxPoolSize JBoss Remoting maintains a client side pool of TCP connections on which to service requests If you have a large number of sessions concurrently accessing the server from a client and cannot obtain connections from the pool you may want to increase this value secondaryBindPort The bisocket transport uses control connections to pass control messages between server and client This attribute defines the address to which
44. ducer producer JBossMessageProducer session createProducer queue 2 Add the enableOrderingGroup method to set an ordering group producer enableOrderingGroup String ogrpName throws JMSException The method creates an ordering group when the method is called JBossMessageProducer sends messages on behalf of the ordering group If you provide null as the method parameter the ordering group is generated automatically A new call to this method overrides the previous call 3 Optionally you can add the disableOrderingGroup method to disable the ordering group public void disableOrderingGroup throws JMSException When the method is called JBossMessageProducer stops sending ordering group messages and resumes its default behavior An example is available in SEAPHOME doc examples jboss messaging examples ordering group in the class OrderingGroupExample java src org jboss example jms ordering OrderingGroupExample java Note that the example is delivered as part of the jboss eap docs archive 9 2 2 Enabling Ordering Group on Connection Factory To enable the ordering group feature on a connection factory add the following attributes to the factory service configuration file EnableOrderingGroup enables the ordering group feature if set to true the default value is false DefaultOrderingGroupName sets the default name of the message ordering group The group name is generated automatically if the attribute is not defined
45. e Any excess messages will be dropped The default value is 1 which is unbounded Clustered This attribute must be set to true if the destination is clustered MessageCounter Each queue maintains a message counter MessageCounterStatistics The statistics for the message counter MessageCounterHistoryDayLimit The maximum number of days for which to hold message counter history Overrides any value set in the Server Peer configuration file ConsumerCount The number of consumers currently consuming from the queue DropOldMessageOnRedeploy Specifies how queue services with clustered attributes that differ from previously deployed attributes are handled If set to true all remaining messages in the queue are deleted after the queue service re deployment if the queue service attribute contains a different clustered attribute If set to false default all messages are reserved A Warning Redeployment Considerations When you re deploy a destination you must shut down all the nodes in the cluster make proper configuration changes and then restart the nodes Redeploying from a non clustered to a clustered queue requires you set the clustered attribute to true and add the queue service configuration to each node Redeploying from a clustered to a non clustered queue requires you set the clustered attribute to false in one of the queue configurations and delete all other queues in the cluster 5 9 2 1 1 Destination Security C
46. e DetectDuplicates gt true lt attribute gt lt The size of the id cache to use when detecting duplicate messages gt lt attribute name IDCacheSize gt 500 lt attribute gt lt attribute name SqlProperties gt CREATE_POSTOFFICE_TABLE CREATE TABLE JBM_POSTOFFICE POSTOFFICE_NAME VARCHAR 255 NODE_ID INTEGER QUEUE_NAME VARCHAR 255 COND VARCHAR 1023 SELECTOR VARCHAR 1023 CHANNEL ID BIGINT CLUSTERED CHAR 1 ALL NODES CHAR 1 PRIMARY KEY POSTOFFICE NAME NODE ID QUEUE NAME ENGINE INNODB INSERT BINDING INSERT INTO JBM POSTOFFICE 21 Chapter 5 Configuration POSTOFFICE_NAME NODE_ID QUEUE_NAME COND SELECTOR CHANNEL_ID CLUSTERED ALL_NODES VALUES DELETE BINDING DELETE FROM JBM POSTOFFICE WHERE POSTOFFICE NAME AND NODE ID AND QUEUE NAME LOAD BINDINGS SELECT QUEUE NAME COND SELECTOR CHANNEL ID CLUSTERED ALL NODES FROM JBM POSTOFFICE WHERE POSTOFFICE NAME AND NODE ID attribute This post office is clustered If you don t want a clustered post office then set to false gt attribute name Clustered gt true lt attribute gt lt All the remaining properties only have to be specified if the post office is clustered You can safely comment them out if your post office is non clustered gt The JGroups group name that the post office will use gt attribute name GroupName gt jboss messaging groupname MessagingPostOf
47. e Message acknowledge method In the AUTO ACKNOWLEDGE and DUPS OK ACKNOWLEDGE modes the completion is signalized by either of the following a successful return from one of the MessageConsumer receive methods or e a successful return from the onMessage call of the MessageListener K If the message consumer is closed the message being processed at the time of its closure is deemed as completed and that regardless of whether _ACKNOWLEDGE was called prior to the closure of the consumer 9 2 How to Enable Message Ordering Group You can enable an ordering group either on a connection factory or on a producer If you define the ordering group on a connection factory all producers on the connection factory use the same ordering group refer to Section 9 2 1 Enabling Ordering Group on Producer 63 Chapter 9 Enabling JBoss Messaging Ordering Group f you define the ordering group on a producer note that the producer is defined on a connection factory the producer uses the defined ordering group If the connection factory of the producer defines an ordering group as well the producer ordering group overrides the setting and uses its own ordering group refer to Section 9 2 2 Enabling Ordering Group on Connection Factory 9 2 1 Enabling Ordering Group on Producer To enable the ordering group feature on producer do the following 1 Adda JBossMessageProducer to your session JBossMessagePro
48. e parameter to 1 to activate retry forever mode This parameter is valid when RetryOnConnectionFailure is set to true 30 JDBCPersistenceManager MBean Attributes Important Closing Clients Issue on Nodes with MaxRetry set to Clients that consume messages from a clustered destination can become unresponsive when closed This happens if the node has the value MaxRetry set to 1 and loses the connection to the database To avoid the problem set the node parameter MaxRetry to a value greater than 1 You can set the attribute value in the MBeans PersistenceManager PostOffice and JMSUserManager in the file database persistence service xml RetryInterval Specifies the retry interval between two consecutive retries The default is 1000 milliseconds This parameter is valid when RetryOnConnectionFailure is setto true CreateTablesOnStartup Specifies whether tables and index creation is attempted when the Persistence Manager is started When set to true default the persistence manager will attempt to create tables and indexes on startup If tables or indexes already exist a SQLException will be thrown by the JDBC driver and ignored by the persistence manager allowing it to continue unhindered UsingBatchUpdates Specifies whether multiple database updates are grouped in batches to improve performance Set this value to true if your database supports JDBC batch updates The default value is false UsingBinaryStream
49. e status while the node is unavailable and will restart the node when it detects JGroups and the database connection is restored to normal operation To enable this functionality declare the MessagingClusterHealthMBean MBean in the ServerPeer MBean as an optional attribute name attribute in a depends directive lt ServerPeer MBean configuration gt mbean code org jboss jms server ServerPeer name jboss messaging service ServerPeer xmbean ddz xmdesc ServerPeer xmbean xm1 lt The unique id of the server peer in a cluster each node MUST have a unique value must be an integer gt attribute name ServerPeerID gt 0 lt attribute gt lt The default JNDI context to use for queues when they are deployed without specifying one se attribute name DefaultQueueJNDIContext gt queue lt attribute gt lt The default JNDI context to use for topics when they are deployed without specifying one Sa lt attribute name DefaultTopicJNDIContext gt topic lt attribute gt lt XML CONFIG REMOVED FOR READABILITY gt depends optional attribute name PersistenceManager gt jboss messaging service PersistenceManager lt depends gt lt XML CONFIG REMOVED FOR READABILITY gt lt depends optional attributename MessagingClusterHealthMBean gt jboss messaging service MessagingClusterHealthMBean lt depends gt lt mbean gt 5 7 Configuring the
50. ectory of the release bundle To enable your database replace the default jboss as server PROFILE deploy messaging hsqldb persistence service xml configuration file with the configuration file for your database type Restart the server to apply the new persistence configuration F Clustered Environment not Enabled by Default Apart from the unsupported Hypersonic configuration the delivered example configurations are by default set for non clustered environments To allow clustered environments for your database configuration set the Clustered attribute to true in your database type gt persistence service xml the default setting is attribute name Clustered gt false lt attribute By default the messaging services rely on a data store reference java DefaultbS for the data source To deploy a data source with a different JNDI name you must update all DataSource attributes in the persistence configuration file Example data source configurations are included in the distribution 20 Configuring the Post Office 5 5 Configuring the Post Office The post office routes messages to their destination or destinations It maintains the mappings between the addresses to which a message can be sent and the final queue For example when sending a message with an address that represents a JMS queue the post office routes the message to that JMS queue When sending a message with an address that represents a JMS topic the pos
51. ed to consume messages matching a particular JMS selector It can be configured to consume from a queue or a topic When the bridge consumes from a topic it can be configured to consume with a non durable or a durable subscription The bridge can be configured to handle messages with one of three quality of service QoS levels Bridge QoS Levels QOS AT MOST ONCE This mode specifies that messages will arrive at the destination once at the most Messages are consumed from the source and acknowledged before they are sent to the destination Messages can be lost if failure occurs between the message leaving the source and arriving at the destination Messages will therefore be delivered once at most This mode is available for both persistent and non persistent messages QOS DUPLICATES OK This mode specifies that messages are consumed from the source and acknowledged after they have been successfully sent to the destination If failure occurs between a message arriving and being acknowledged by the destination that message is sent a second time when the system recovers This mode is available for both persistent and non persistent messages QOS ONCE AND ONLY ONCE This mode specifies that messages will arrive exactly once When the message source and destination are on the same JBoss Messaging server instance the message can be sent and received in the same local transaction 57 Chapter 8 JBoss Messaging Message Bridge Configuratio
52. elay gt 0 lt attribute gt lt The periodicity of the message counter manager enquiring on queues for statistics gt lt attribute name MessageCounterSamplePeriod gt 5000 lt attribute gt lt The maximum amount of time for a client to wait for failover to start on the server side after it has detected failure gt attribute name FailoverStartTimeout gt 60000 lt attribute gt The maximum amount of time for a client to wait for failover to complete on the server side after it has detected failure gt attribute name FailoverCompleteTimeout gt 300000 lt attribute gt attribute name StrictTck gt false lt attribute gt lt The maximum number of days results to maintain in the message counter history attribute name DefaultMessageCounterHistoryDayLimit gt 1 lt attribute gt The name of the connection factory to use for creating connections between nodes to pull messages attribute name ClusterPullConnectionFactoryName gt jboss messaging connectionfactory service ClusterPullConnectionFactory lt attribute gt lt When redistributing messages in the cluster Do we need to preserve the order of messages received by a particular consumer from a particular producer gt lt attribute name DefaultPreserveOrdering gt false lt attribute gt lt Max time to hold previously delivered messages back waiting for clients to reconnect after failover gt lt attribute n
53. ement is not overridden the default Hypersonic configuration will be used for that statement MaxParams When loading messages the persistence manager will generate prepared statements with many parameters This value tells the persistence manager what the absolute maximum number of parameters are allowable per prepared statement By default the value of MaxParams attribute is set to 100 UseNDBFailoverStrategy When running in a clustered database environment it is possible that some databases MySQL for instance can fail during the commit of a database transaction This can happen if the database node dies whilst committing meaning that the final state of the transaction is unknown If this attribute is set to true and the above happens then the SQL statement will be re executed however if there is a further error an assumption is made that this is because the previous transaction committed successfully and the error is ignored By default the value of UseNDBFailoverStrategy attribute is set to false Database Connection Retry Parameters control whether a connection should be re established when a connection failure is detected how many attempts to reconnect should be made and at what interval each attempt should be made RetryOnConnectionFailure Specifies whether the MBean should attempt to reconnect to the database The default is false MaxRetry Specifies the maximum limit for DataSource connection failures The default is 25 Set th
54. en criteria ResetMessageCounter Resets the message counter to zero ResetMessageCounterHistory Resets the message counter history ListAllSubscriptionsASHT ML Lists all subscriptions belonging to this topic in HTML format ListDurableSubscriptionsASHTML Lists all durable subscriptions belonging to this topic in HTML format ListNonDurableSubscriptions Lists all non durable messages belonging to the specified subscription Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the given criteria 41 Chapter 5 Configuration ListNonDurableSubscriptionsASHTML Lists all non durable subscriptions belonging to this topic in HTML format 5 10 Configuring Connection Factories JBoss Messaging is configured by default to bind two connection factories in JNDI upon startup The first connection factory is the default non clustered connection factory This connection factory is provided to maintain compatibility with applications originally written against JBossMQ which does not include automatic failover or load balancing If you do not require client side automatic failover or load balancing then you should use this first connection factory The first connection factory is bound into the following JNDI contexts ConnectionFactory XAConnectionFactory java ConnectionFactory e java XAConnectionFactory The second connection factory is the default cl
55. essaging Ordering Group This section describes how to use the JBoss Messaging ordering group feature to achieve strict message ordering Message ordering groups is the JBoss Messaging implementation of strict message ordering When the ordering group feature is enabled message priorities no longer have an influence on the order that the messages are delivered Messages of a particular ordering group are delivered in the exact order that they arrive at the target queue FIFO The next message of an ordering group is delivered only after the delivery of the previous messages has been accomplished To signalize a successful message delivery the acknowledge mechanism is used refer to Section 9 1 Acknowledge Mechanism Transactional Receipt In the case of the transactional receipt of messages the next message is not delivered until the transaction has been committed which includes the acknowledgment of the receipt of the current message If the transaction is rolled back the message is canceled sent back to the JMS server and made available for the next delivery 9 1 Acknowledge Mechanism The messages that form a part of an ordering group are delivered one at a time The next message is delivered only after the delivery of a previous message was completed Message delivery completion is signaled by various means depending on the acknowledge mode settings In the CLIENT ACKNOWLEDGE mode the completion state is signalized by th
56. et port 4457 lt attribute gt lt attribute name clientSocketClass isParam true gt org jboss jms client remoting ClientSocketWrapper lt attribute gt lt attribute name serverSocketClass gt org jboss jms server remoting ServerSocketWrapper lt attribute gt lt attribute name onewayThreadPool gt org jboss jms server remoting DirectThreadPool lt attribute gt lt the following parameters are useful when there is a firewall between client and server Uncomment them if so gt les attribute name numberOfCallRetries isParam true gt 1 lt attribute gt lt attribute name pingFrequency isParam true gt 214748364 lt attribute gt attribute name pingWindowFactor isParam true gt 10 lt attribute gt attribute name generalizeSocketException isParam true gt true lt attribute gt gt lt Now remoting supports socket write timeout configuration Uncomment this if you need it gt ess attribute name writeTimeout isParam true gt 30000 lt attribute gt gt lt End immutable parameters gt lt attribute name stopLeaseOnFailure isParam true gt true lt attribute gt lt Periodicity of client pings Server window by default is twice this figure gt lt attribute name clientLeasePeriod isParam true gt 10000 lt attribute gt lt attribute name validatorPingPeriod isParam true gt 10000 lt attribute gt lt attribute name validatorPingTimeout isParam true gt 50
57. et this to true if the database supports JDBC batch updates The JDBC Persistence Manager will then group multiple database updates in batches to aid performance By default the value of UsingBatchUpdates attribute is set to false UsingBinaryStream Set this to true if you want messages to be store and read using a JDBC binary stream rather than using getBytes setBytes Some database has limits on the maximum number of bytes that can be get set using getBytes setBytes By default the value of UsingBinaryStream attribute is set to true Chapter 5 Configuration UsingTrailingByte Certain version of Sybase are known to truncate blobs if they have trailing zeros To prevent this if this attribute is set to true then a trailing non zero byte will be added and removed to each blob before and after persistence to prevent the database from truncating it Currently this is only known to be necessary for Sybase By default the value of UsingTrailingByte attribute is set to false SupportsBlobOnSelect Oracle and possibly other databases is known to not allow BLOBs to be inserted using a INSERT INTO SELECT FROM statement and requires a two stage conditional insert of messages If this value is false then such a two stage insert will be used By default the value of SupportsBlobOnSelect attribute is set to true SQLProperties This is where the DDL and DML for the particular database is specified If a particular DDL or DML stat
58. eue mySourceQueue TargetDestinationLookup The full JNDI lookup for the target destination via the TargetProviderLocator such as topic myTargetTopic SourceUsername An optional attribute that specifies the username used when creating the source connection SourcePassword An optional attribute that specifies the password used when creating the source connection TargetUsername An optional attribute that specifies the username used when creating the target connection TargetPassword An optional attribute that specifies the password used when creating the target connection QualityOfServiceMode An integer representing the desired quality of service mode The possible values are 0torepresent QOS AT MOST ONCE e 1torepresent QOS DUPLICATES OK e 2 to represent QOS ONCE AND ONLY ONCE See Section 8 1 Message Bridge Overview for a complete explanation of these modes Selector An optional attribute that lets you provide a JMS selector expression when consuming messages from a source destination Only messages that match the selector expression are bridged from the source to the target destination The selector expression must follow the JMS selector syntax specified here http java sun com j2ee 1 4 docs api javax jms Message html For optimal performance apply source topic subscription selectors to source queue consumers 60 Bridge Configuration MaxBatchSize Specifies the maximum number of messages to consume fr
59. fault MDB properties You can configure MDBs to have default properties using the Qorg jboss ejb3 annotation DefaultActivationSpecs annotations true Whether the MDB should make the subscription at initial deployment or wait for start or stopDelivery on the corresponding MBean You can set this to false if you want to prevent messages from being delivered to the MDB which is still starting during server startup 52 Chapter 6 Clustering Notes To help locate clustering related information a summary of each consideration is provided in this part of the guide with links to the related components of JBoss Messaging 6 1 Unique Server Peer ID In most cases JBoss Messaging works in a clustered environment with minimal configuration changes One crucial change that must be made is that every node is assigned a unique server ID Every deployed node must have a unique ID including nodes that form a LAN cluster and nodes linked by message bridges The ServerPeer ID attribute is used to set this information Refer to Section 5 2 ServerPeer attributes for further information 6 2 Clustered Destinations JBoss Messaging clusters Java Message Service JMS queues and topics transparently across the cluster Messages sent to a distributed queue or topic on one node are consumable on other nodes To make a particular destination clustered the clustered attribute is used to set this functionality Refer to
60. fice lt attribute gt lt Max time to wait for state to arrive when the post office joins the cluster gt lt attribute name StateTimeout gt 5000 lt attribute gt lt Max time to wait for a synchronous call to node members using the MessageDispatcher gt lt attribute name CastTimeout gt 50000 lt attribute gt lt Set this to true if you want failover of connections to occur when a node is shut down gt lt attribute name FailoverOnNodeLeave gt false lt attribute gt lt JGroups stack configuration for the data channel used for sending data across the cluster gt lt By default we use the TCP stack for data gt lt attribute name DataChannelConfig gt lt config gt lt TCP start_port 7900 loopback true recv_buf_size 20000000 send_buf_size 640000 discard incompatible packets true max bundle size 64000 max bundle timeout 30 use incoming packet handler true use outgoing packet handler false down thread false up thread false enable bundling false use send queues false Sock conn timeout z 300 skip suspected members true MPING timeout 4000 bind to all interfaces true mcast_addr jboss messaging datachanneludpaddress 228 6 6 6 mcast_port jboss messaging datachanneludpport 45567 ao eee 22 Configuring the Post Office num_initial_members 2 num_ping_requests 1 gt lt MERGE2 max_interval 100000 down_thread false
61. fined for a clustered environment lt attribute name Clustered gt true lt attribute gt 19 Chapter 5 Configuration yi Do not Use Hypersonic in Production xd Although Hypersonic configuration is used as the default persistence configuration Hypersonic is not supported in production due to the following known issues e no transaction isolation thread and socket leaks connection close does not tidy up resources persistence quality logs commonly become corrupted after a failure preventing automatic recovery database corruption stability under load database processes cease when dealing with too much data not viable in clustered environments The Hypersonic database is intended for developing and testing purposes and should not be used in a production environment For more information about recommended databases refer to the Using Other Databases chapter in the Getting Started Guide The Persistence Manager Post Office and JMS User Manager all interact with persistent storage The Persistence Manager handles message related persistence The Post Office handles binding related persistence The JMS User Manager handles user related persistence All configuration for these managed beans is handled in the your database type gt persistence service xml file Example configuration files for MySQL Oracle PostgreSQL Microsoft SQL Server or Sybase databases are available in the jboss as docs examples jms dir
62. fines the maximum number of times message delivery will be attempted before the message is sent to the DLQ if configured The default value is 1 which specifies that the value from the Server Peer configuration file be used Any other setting overrides the Server Peer value CreatedProgrammatically Returns true if the topic was created programmatically MaxSize Specifies the maximum number of messages that can be held in a topic subscription Any excess messages will be dropped from the topic The default value is 1 which applies no size restriction Clustered Set this to true if your destination is clustered MessageCounterHistoryDayLimit Defines the maximum number of days to retain message counter history and overrides any value set in the Server Peer configuration file MessageCounters Returns a list of message counters for the topic s subscriptions AllMessageCount Returns the total number of messages in all subscriptions belonging to the topic DurableMessageCount Returns the total number of durable messages in all subscriptions belonging to this topic NonDurableMessageCount Returns the total number of non durable messages in all subscriptions belonging to this topic DropOldMessageOnRedeploy Specifies how queue services with clustered attributes that differ from previously deployed attributes are handled If set to true all remaining messages in the queue are deleted after the queue service re deployment if the queue ser
63. ge counters to zero enableMessageCounters Enables all message counters for all destinations Message counters are disabled by default disableMessageCounters Disables all message counters for all destinations Message counters are disabled by default retrievePreparedTransactions Retrieves a list of the XIDs for all transactions currently in a prepared state on the node showPreparedTransactions Retrieves a list of the XIDs for all transactions currently in a prepared state on the node in an easily displayed HTML format listAllPreparedTransactions Displays the details of all prepared transactions listPreparedTransactions Displays the details of all prepared transactions where the transaction ages are equal to or older than a specified time showMessageDetails Displays the details of a message The message ID is used to specify the message to display commitPreparedTransaction Manually commit a prepared transaction The transaction ID is used to specify the transaction to commit rollbackPrepared Transaction Manually roll back a prepared transaction The transaction ID is used to specify the transaction to roll back 5 4 Changing the Database JMS uses the database defined in jboss as server PROFILE deploy messaging lt DATABASE_TYPE gt persistence service xml as a persistence storage The default persistence storage type is Hypersonic HSQLDB defined in hsqldb persistence service xml Note that the configuration is de
64. he following list DataSource The datasource the postoffice should use for persisting its mapping data SQLProperties This is where the DDL and DML for the particular database is specified If a particular DDL or DML statement is not overridden the default Hypersonic configuration will be used for that statement CreateTablesOnStartup Set this to true if you wish the post office to attempt to create the tables and indexes when it starts If the tables or indexes already exist a SQLException will be thrown by the JDBC driver and ignored by the Persistence Manager allowing it to continue By default the value of CreateTablesOnStartup attribute is set to true DetectDuplicates Set this to true if you wish the post office detect duplicate messages that may sent when a send is retried on a different node after server failure By default the value of DetectDuplicates attribute is set to true IDCacheSize If duplicate detection is enabled See DetectDuplicates then the server will remember the last n message ids sent to prevent duplicate messages sent after failover has occurred The value of n is determined by this attribute By default the value of IDCacheSize attribute is set to 500 PostOfficeName The name of the post office NodelDView This returns set containing the node ids of all the nodes in the cluster GroupName All post offices in the cluster with the same group name will form a cluster together Make sure the group
65. imum number of times delivery will be attempted for a message before the message is removed or sent to the DLQ if configured The default value is 10 You can override this value on a per destination basis DefaultExpiryQueue The default expiry queue that the ServerPeer will use for destinations You can override this value on a per destination basis as seen in the section on destination managed bean configuration An expiry queue holds messages that have expired Message expiry is determined by the value of Message get JMSExpiration If the expiry queue is not specified the message will be deleted when it expires DefaultRedeliveryDelay This attribute lets you delay a redelivery attempt which helps to prevent thrashing delivery failure The default value is 0 that is no delay You can override this value on a per destination basis MessageCounterSamplePeriod This attribute defines the period of time between the server s queries to the queue for queue statistics The default value is 5000 milliseconds FailoverStartTimeout The longest period in milliseconds that the client will wait for failover to begin on the server side when a problem is detected The default value is 60000 one minute FailoverCompleteTimeout The longest period in milliseconds that the client will wait for failover to complete on the server side once failover has been initiated The default value is 300000 five minutes DefaultMessageCounterHistoryDa
66. ion thrown by a JMS XAResource in the event that the prepare method is called after the connection is broken Set this property via the command line on server startup with the D option If this property is not defined an XAException with an XA RBCOMMFAIL error code will be thrown Otherwise an XAException with an XA RETRY error code will be thrown It should be noted that JBoss Messaging does not define this property by default Chapter 3 JBoss Messaging Installation JBoss Enterprise Application Platform EAP comes with JBoss Messaging pre installed as the default JMS provider If you are using EAP version 4 3 or higher there is no need to manually install JBoss Messaging Chapter 4 Examples JBoss Messaging has a number of examples that are available for download Download the examples archive file from https access redhat com Task Download JBoss Messaging Examples Zip Follow this task to download the JBoss Messaging Example Zip bundle The examples are contained within the documentation bundle for the platform Prerequisites You have the correct entitlements for JBoss Enterprise Application Platform on access redhat com 1 Log into the Red Hat Customer Portal 2 Select Downloads JBoss Enterprise Middleware Downloads 3 Onthe Software Downloads page select Application Platform from the Product drop down menu The Version drop down menu defaults to the latest release 4 Locate the App
67. ive messages and browse the destination write Specifies the role can create producers or send messages to the destination create Specifies the role can create durable subscriptions on this destination Configuring security for a destination is optional If a SecurityConfig element is not specified then the default security configuration from the Server Peer will be used instead 5 9 3 1 2 Destination paging parameters Previously for an application to support a queue or subscription the queue needed to be stored entirely in memory This was not always possible for very large queues or subscriptions Pageable Channels is a new JBoss Messaging feature that lets you specify a maximum number of messages to be stored in memory at one time on a queue by queue or topic by topic basis JBoss Messaging then pages messages to and from storage transparently in blocks This allows queues and subscriptions to grow to very large sizes without any degradation in performance as channel size increases It has been tested with queues in excess of ten million 2 kilobyte messages on very basic hardware and has the potential to scale to much greater message numbers The individual parameters associated with pageable channels are as follows FullSize Specifies the maximum number of messages held by the queue or topic subscription in memory at any one time The actual queue can hold more messages but these are paged to and from storage as messages are a
68. lication Platform version Documentation entry and click Download 5 The documentation bundle begins to download Related Information e Task Unpack and Deploy Examples Task Unpack and Deploy Examples Complete this task to unpack the JBoss Messaging examples from the platform documentation bundle and meet all basic configuration requirements to run the examples e Task Download JBoss Messaging Examples Zip A running JBoss Enterprise Application Server instance with default settings 1 Openthe zip archive using an archive utility appropriate for your operating system 2 nthe zip archive manager navigate to jboss eap 5 1 doc 3 Extract the examples directory to JBOSS_HOME docs examples 4 Open JBOSS HOME docs examples jboss messaging examples destinations ina file browser 5 Copy jbm examples destinations service xmlto JBOSS HOME server default deploy to deploy the destinations configuration directives required by the examples Related Information e Unclustered Examples Clustered Examples Chapter 4 Examples Unclustered Examples Sop important You must run the Unclustered examples on JBoss Enterprise Application Platform non clustered profiles the All and Production profiles are not supported The readme html for each example provides the setup details expected output and simple troubleshooting queue This example shows a simple send and receive to a remote queue using a JMS client
69. ll delete all data for the queue This operation returns true if the queue was destroyed successfully Otherwise it returns false deployTopic Used to programmatically deploy a topic There are two overloaded versions of this operation The first deploys already existing topics with the default paging parameters The second creates and deploys topics with specified paging parameters For more information about destinations refer to Section 5 9 Configuring Destinations The name parameter represents the name of the destination to deploy The jndiName represents the full JNDI name of the location to which the destination will be bound If this is not specified the destination will be bound in DefaultTopicJNDIContext lt name gt undeploy Topic Used to programmatically undeploy a topic Topics are undeployed but not removed from persistent storage This operation returns true if the topic is undeployed successfully Otherwise false is returned destroyTopic Used to programmatically destroy a topic Topics are undeployed and all data is removed from the database and destroyed This operation returns true if the topic is successfully destroyed Otherwise it returns false 18 Changing the Database by Warning Exercise caution when using this method it will delete all data for the topic listMessageCountersHTML Returns message counters in a simply displayed HTML format resetAllMesageCounters Resets all messa
70. me a shell command and a keycap all presented in mono spaced bold and all distinguishable thanks to context Key combinations can be distinguished from keycaps by the hyphen connecting each part of a key combination For example Press Enter to execute the command Press Ctr l Alt F2 to switch to the first virtual terminal Press Ctr 1 Alt F1 to return to your X Windows session The first paragraph highlights the particular keycap to press The second highlights two key combinations each a set of three keycaps with each set pressed simultaneously If source code is discussed class names methods functions variable names and returned values mentioned within a paragraph will be presented as above in mono spaced bold For example File related classes include filesystem for file systems file for files and dir for directories Each class has its own associated set of permissions Proportional Bold This denotes words or phrases encountered on a system including application names dialog box text labeled buttons check box and radio button labels menu titles and sub menu titles For example Choose System Preferences Mouse from the main menu bar to launch Mouse Preferences In the Buttons tab click the Left handed mouse check box and click https fedorahosted org liberation fonts Preface Close to switch the primary mouse button from the left to the right making the mouse suitable for use in the left hand
71. must be an integer gt attribute name ServerPeerID gt jboss messaging ServerPeerID 0 lt attribute gt lt The default JNDI context to use for queues when they are deployed without specifying one gt attribute name DefaultQueueJNDIContext gt queue lt attribute gt lt The default JNDI context to use for topics when they are deployed without specifying one gt lt attribute name DefaultTopicJNDIContext gt topic lt attribute gt attribute name PostOffice gt jboss messaging service PostOffice attribute The default Dead Letter Queue DLQ to use for destinations This can be overridden on a per destinatin basis gt 13 Chapter 5 Configuration lt attribute name DefaultDLQ gt jboss messaging destination service Queue name DLQ lt attribute gt lt The default maximum number of times to attempt delivery of a message before sending to the DLQ if configured This can be overridden on a per destination basis gt lt attribute name DefaultMaxDeliveryAttempts gt 10 lt attribute gt lt The default Expiry Queue to use for destinations This can be overridden on a per destinatin basis lt attribute name DefaultExpiryQueue gt jboss messaging destination service Queue name ExpiryQueue lt attribute gt lt The default redelivery delay to impose This can be overridden on a per destination basis gt lt attribute name DefaultRedeliveryD
72. n If the source and destination are on different servers you can implement message high durability by using a JTA transaction controlled by JBoss Transactions JTA implementation If JTA is required both connection factories must be XAConnectionFactory implementations This mode is only available for persistent messages This mode requires logging on both the transaction manager and the resource side to support recovery If you require this level of QOS you must enable XA Recovery with JBoss Transactions Alternative Methods You may be able to apply once and only once semantics to a specific application without setting QOS_ONCE_AND_ONLY_ONCE Set QOS_DUPLICATES_OK mode and then check for and discard duplicate messages at the destination You can implement QOS_ONCE_AND_ONLY_ONCE behaviour at the application level by maintaining a cache of received message IDs on disk and comparing received messages to this cache Because the cache would only be valid for a certain period of time this approach is not infallible but can be a useful alternative depending on your application 8 2 Bridge deployment You can deploy a message bridge by adding a managed bean descriptor into the deploy directory of the JBoss Enterprise Application Platform installation that contains JBoss Messaging 8 3 Bridge Configuration The following code is an example configuration of the message bridge showing all attributes Some attributes have been commente
73. n 7 4 Examples 9 5 Configuration 13 5 1 Configuring the ServerPeer cccecece cece eee eee eee eres eee seen ee mene nennen rene nr s rrr enr en nnns 13 5 2 ServerPeer attributes cso on ue ee Lose ee ure dr E repe pee A 15 5 3 ServerPeer methods sedute A eR T epe ct BNET So u Re Rb ERE RE TREE saath 17 5 4 Changing the Database ssssssssssseeeee nene mene nennen rene nnne nnne nnns 19 5 5 Configurng thie Post Offlce er tee ee Dee i eei Ule i 21 5 5 1 MessagingPostOffice Attributes ssssssssseee mene 24 5 6 Configure the MessagingClusterHealthMBean sss 26 5 7 Configuring the Persistence Manager ssssssssse meme rennen 27 5 7 1 JDBCPersistenceManager MBean Attributes sssssseee emm 29 5 8 Configuring the JMS user manager sssssssssssem eee ener rennen 32 5 8 1 JMSUserManager MBean Attributes sssssssseee eem 33 5 9 Configuring DESTINATIONS e deett esee depen Ete ledge UE E E ER EG RN RRE Sanaan 34 5 9 1 Pre configured destinations sssssssssssseeeem mene meer 34 5 9 2 Configuring QUEUES i nipani aaaeaii ae nennen nenne Din araa aeai De se seh nennen nns 35 5 9 3 Configuririg TOPICS 2 715 oorr Eee Sez dr eee edere taxe te do va eee de runde edt dh 38 5 10 Configuring Connection Factories sssssssssss semen 42 5 10 1 ConnectionFactory Managed Bean Attributes
74. name matches with all the nodes in the cluster you want to form a cluster with Clustered If true the post office will take part in a cluster to form distributed queues and topics If false then it will not participate in the cluster If false then all the cluster related attributes will be ignored 24 MessagingPostOffice Attributes StateTimeout The maximum time to wait when waiting for the group state to arrive when a node joins a pre existing cluster The default value is 5000 milliseconds CastTimeout The maximum time to wait for a reply casting message synchronously The default value is 5000 milliseconds FailoverOnNodeLeave Specifies how messages stored on a node are redistributed when a node is cleanly shutdown The default value is false If true when a server node is shut down cleanly using Ctr1 C in the terminal all messages stored on the node are moved to another node in the cluster Sop important Clients originally connected to the cleanly shutdown node are not automatically reconnected to the failover node in the cluster Clients return an exception upon message failover MaxConcurrentReplications The maximum number of concurrent replication requests to make before blocking for replies to come back This prevents us overwhelming JGroups This is rarely a good reason to change this The default value is 50 ControlChannelConfig JBoss Messaging uses JGroups for all group management
75. ne the SuckerPassword on the SecurityMetadataStore Ab amia The SuckerPassword must be changed at install time or the default password will be used giving any user who knows the default password access to any destination on the server SuckerConnectionRetryTimes This is the maximum number of times a sucker s connection is permitted to retry in the event of a failure The default value is 1 which represents retry indefinitely SuckerConnectionRetryInterval This is the interval in milliseconds between each retry of the failed sucker s connection The default value is 5000 StrictTck To enable strict JMS Technology Compatibility Kit TCK semantics set this attribute to true Destinations Returns a list of the destinations queues and topics currently deployed MessageCounters A message counter for a particular queue MessageStatistics Statistics about each message counter for each queue SupportsFailover When this attribute is false server side failover does not occur when a node crashes in a cluster PersistenceManager The persistence manager used by the ServerPeer You will not normally need to change this attribute JMSUserManager The JMS user manager used by the ServerPeer You will not normally need to change this attribute SecurityStore The pluggable SecurityStore If you redefine this attribute remember that you will need to authenticate the MessageSucker user JBM SUCKER with all special permissions
76. om the source destination before sending a message batch to the target destination Its value must be greater than or equal to 1 MaxBatchTime Specifies the longest period in milliseconds to wait before sending a message batch to the target even if the MaxBatchSize has not been reached Its value must be either 1 wait forever or greater than or equal to 1 to specify a time SubName Represents the name of the durable subscription that will consume from the source destination topic ClientlD Represents the JMS client ID to use when creating or looking up the durable subscription that will consume from the source destination topic FailureRetryInterval The period of time in milliseconds to wait between attempting to recreate the connection to the Source or target server after failure is detected MaxRetries The number of times to attempt to recreate the connection to the source or target server after failure is detected The bridge will then stop attempting to recreate the connection A value of 1 means that the bridge will continue to attempt to reconnect forever AddMessagelDInHeader When true the original message ID is added to the JBossMessage JBOSS MESSAGING BRIDGE MESSAGE ID LIST header of the message being sent to the destination If the message is bridged multiple times each message ID is added to the header This enables a distributed request response pattern 61 62 Chapter 9 Enabling JBoss M
77. onfiguration lt SecurityConfig gt determines which roles can read write and create upon the destination It uses the same syntax and semantics as JBossMQ destination security configuration lt SecurityConfig gt lt security gt lt role read true write true create true gt lt security gt lt SecurityConfig gt The lt SecurityConfig gt element must contain one lt security gt element which can contain multiple lt role gt elements A lt role gt element defines the access type for that particular role using the following attributes read Specifies the role can create consumers receive messages and browse the destination 36 Configuring Queues write Specifies the role can create producers or send messages to the destination create Specifies the role can create durable subscriptions on this destination lcaua Configuring security for a destination is optional If a SecurityConfig element is not specified then the default security configuration from the Server Peer will be used instead 5 9 2 1 2 Destination paging parameters Pageable Channels is a JBoss Messaging feature that lets you specify a maximum number of messages to be stored in memory at one time on a queue by queue or topic by topic basis JBoss Messaging then pages messages to and from storage transparently in blocks This allows queues and subscriptions to grow to very large sizes without any degradation in performance
78. queues If a sent message includes the replyTo of a temporary queue it can be returned on any node of the cluster Intelligent message redistribution Messages are automatically moved between nodes of the cluster to take advantage of different consumer speeds on different nodes This helps to prevent starvation or build up of messages on a particular node Message order protection Enable this to ensure that the order of messages produced by a producer is identical to the order of messages consumed by a consumer This works even if message redistribution is active Completely transparent failover When a server fails your sessions continue exception free on a new node This is also completely configurable if you do not want to implement this failover behavior you can disable it and fall back to exceptions being thrown and manually recreating connections on a new node High availability and seamless failover If the node fails you will automatically failover to a different node without losing any persistent messages and can seamlessly continue your session Once and only once delivery of persistent messages is respected at all times Message bridge JBoss Messaging contains a message bridge component which lets you bridge messages between any two JMS 1 1 destinations This lets you connect geographically separate clusters and form large globally distributed logical queues and topics 2 2 Compatibility with JBoss MQ JBoss MQ was the
79. required by clustering SupportsTxAge Specifies whether the transaction creation time is stored in the transaction record If set to true the transaction record is stored The default is False 5 3 ServerPeer methods The following methods are available for the ServerPeer managed bean 17 Chapter 5 Configuration deployQueue Used to programmatically deploy a queue If the queue exists but is undeployed it will be deployed Otherwise it is created and deployed The name parameter matches a destination to deploy The optional jndiName parameter represents the full JNDI name of the location to which a destination will be bound If this is not specified the destination will be bound in lt DefaultQueueJNDIContext gt lt name gt There are two overloaded versions of this operation The first deploys the destination with default paging parameters The second deploys the destination with the paging parameters specified For more information about paging parameters refer to Section 5 9 Configuring Destinations undeployQueue Used to programmatically undeploy a queue Queues are not removed from persistent storage This operation returns true if the queue is successfully undeployed Otherwise it returns false destroyQueue Used to programmatically destroy a queue Queues are undeployed and all of their data is removed from the database and destroyed Ab Warming Exercise caution when using this method since it wi
80. s Messaging for JBoss Enterprise Application Platform Chapter 2 Introduction JBoss Messaging provides an open source and standards based messaging platform to bring enterprise class messaging to the mass market JBoss Messaging implements a robust high performance messaging core designed to support Service Oriented Architectures SOAs Enterprise Service Buses ESBs and other integration requirements regardless of the level of demand JBoss Messaging lets you distribute application load evenly across your cluster It balances each node s CPU cycles with no single point of failure providing a highly scalable and performant clustering implementation JBoss Messaging includes a Java Messaging Service JMS front end so that messages are delivered in a standards based format and to enable support for other messaging protocols in the future 2 1 JBoss Messaging Features JBoss Messaging provides the following features A strong focus on performance reliability and scalability with high throughput and low latency A foundation for JBoss ESB for SOA initiatives JBoss ESB uses JBoss Messaging as its default JMS provider JBoss Messaging also includes publish subscribe and point to point messaging models persistent and non persistent messages guaranteed message delivery that ensures messages arrive once and only once where required atransactional and reliable interface that supports ACID semantics acu
81. ss Messaging ships with a default set of preconfigured destinations that are deployed at server start up The configuration information for these destinations can be found in the following section of destinations service xml I The Default Dead Letter Queue This destination is a dependency of an EJB MDB container gt mbean code org jboss jms server destination QueueService name jboss messaging destination service Queue name DLQ xmbean dd xmdesc Queue xmbean xm1 depends optional attribute name ServerPeer gt jboss messaging service ServerPeer lt depends gt lt depends gt jboss messaging service PostOffice lt depends gt lt mbean gt oe The Default Expiry Queue gt lt mbean code org jboss jms server destination QueueService name jboss messaging destination service Queue name ExpiryQueue xmbean ddz xmdesc Queue xmbean xm1 depends optional attribute name ServerPeer jboss messaging service ServerPeer c depends lt depends gt jboss messaging service PostOffice lt depends gt lt mbean gt 34 Configuring Queues 5 9 2 Configuring Queues 5 9 2 1 Queue MBean Attributes Name Defines the queue name JNDIName Defines the JNDI name that binds the queue DLQ Defines the DLQ Dead Letter Queue for this queue and overrides any value set in the Server Peer configuration file ExpiryQueue Defines the expiry queue and overrides any value set in the Server
82. stomizable JAAS based security framework complete integration with JBoss Transactions previously Arjuna JTA to support full transaction recovery an extensive JMX management interface support for most major databases including Oracle DB2 Sybase Microsoft SQL Server PostgreSQL and MySQL HTTP transport for use with firewalls that allow only HTTP traffic servlet transport to allow messaging through a dedicated servlet SSL transport configurable Dead Letter Queues DLQs and Expiry Queues message statistics which provide a rolling historical view of the messages delivered to queues and subscriptions the automatic paging of messages to storage which lets you use very large queues that would be too large to fit entirely within system memory and Chapter 2 Introduction strict message ordering which results in messages belonging to a particular message group being delivered according to the order of their arrival at the target queue JBoss Messaging also includes the following clustering features Fully clustered queues and topics Logical queues and topics are distributed across the cluster You can send or receive a queue or topic to or from any node on the cluster Fully clustered durable subscriptions A particular durable subscription can be accessed from any node of the cluster letting you spread processing load from that subscription across the entire cluster Fully clustered temporary
83. t office routes the message to a set of queues one for each JMS subscription The post office also handles the persistence for address mapping JBoss Messaging post offices are cluster aware In a cluster they automatically route push and pull messages between nodes in order to provide fully distributed JMS queues and topics Configure the post office in the database type gt persistence service xml file For example mbean code org jboss messaging core jmx MessagingPostOfficeService name jboss messaging service PostOffice xmbean dd z xmdesc MessagingPostOffice xmbean xml depends optional attribute name ServerPeer gt jboss messaging service ServerPeer lt depends gt lt depends gt jboss jca service DataSourceBinding name DefaultDS lt depends gt depends optional attribute name TransactionManager gt jboss service TransactionManager lt depends gt lt The name of the post office gt lt attribute name PostOfficeName gt JMS post office lt attribute gt lt The datasource used by the post office to access it s binding information gt attribute name DataSource gt java DefaultDS lt attribute gt lt If true will attempt to create tables and indexes on every start up gt lt attribute name CreateTablesOnStartup gt true lt attribute gt lt If true then we will automatically detect and reject duplicate messages sent during failover gt lt attribute nam
84. t be specified with property names starting with POPULATE TABLES as in the above example Database Connection Retry Parameters control whether a connection should be re established when a connection failure is detected how many attempts to reconnect should be made and at what interval each attempt should be made RetryOnConnectionFailure Specifies whether the MBean should attempt to reconnect to the database The default is false MaxRetry Specifies the maximum limit for DataSource connection failures The default is 25 Set the parameter to 1 to activate retry forever mode This parameter is valid when RetryOnConnectionFailure is set to true 33 Chapter 5 Configuration Important Closing Clients Issue on Nodes with MaxRetry set to Clients that consume messages from a clustered destination can become unresponsive when closed This happens if the node has the value MaxRetry set to 1 and loses the connection to the database To avoid the problem set the node parameter MaxRetry to a value greater than 1 You can set the attribute value in the MBeans PersistenceManager PostOffice and JMSUserManager in the file database persistence service xml RetryInterval Specifies the retry interval between two consecutive retries The default is 1000 milliseconds This parameter is valid when RetryOnConnectionFailure is set to true 5 9 Configuring Destinations 5 9 1 Pre configured destinations JBo
85. tees eene nene nnne nnne rens r ne rne nnne 63 9 2 How to Enable Message Ordering Group sssssssee mene 63 9 2 1 Enabling Ordering Group on Producer sssssssee eee 64 9 2 2 Enabling Ordering Group on Connection Factory sssssee 64 9 3 Notes and Limitations 5 eoo e i een x cen BE es Re i s 65 A Revision History 67 Preface 1 Document Conventions This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information In PDF and paper editions this manual uses typefaces drawn from the Liberation Fonts set The Liberation Fonts set is also used in HTML editions if the set is installed on your system If not alternative but equivalent typefaces are displayed Note Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default 1 1 Typographic Conventions Four typographic conventions are used to call attention to specific words and phrases These conventions and the circumstances they apply to are as follows Mono spaced Bold Used to highlight system input including shell commands file names and paths Also used to highlight keycaps and key combinations For example To see the contents of the file my next bestselling novelin your current working directory enter the cat my next bestselling novel command at the shell prompt and press Enter to execute the command The above includes a file na
86. tes are tips shortcuts or alternative approaches to the task at hand Ignoring a note should have no negative consequences but you might miss out on a trick that makes your life easier Important Important boxes detail things that are easily missed configuration changes that only apply to the current session or services that need restarting before an update will apply Ignoring a box labeled Important will not cause data loss but may cause irritation and frustration Warnings should not be ignored Ignoring warnings will most likely cause data loss 2 Getting Help and Giving Feedback 2 1 Do You Need Help If you experience difficulty with a procedure described in this documentation visit the Red Hat Customer Portal at http access redhat com Through the customer portal you can search or browse through a knowledgebase of technical support articles about Red Hat products submit a support case to Red Hat Global Support Services GSS vii Preface access other product documentation Red Hat also hosts a large number of electronic mailing lists for discussion of Red Hat software and technology You can find a list of publicly available mailing lists at https www redhat com mailman listinfo Click on the name of any mailing list to subscribe to that list or to access the list archives 2 2 Give us Feedback If you find a typographical error or know how this guide can be improved we would love to hear
87. tion arjunacore TransactionManagerImple gt property name com arjuna ats jta jtaUTImplementation value com arjuna ats internal jta transaction arjunacore UserTransactionImple gt esie Add this line to enable recovery for JMS resources using DefaultJMSProvider aoe property name com arjuna ats jta recovery XAResourceRecovery JBMESSAGING1 value org jboss jms server recovery MessagingXAResourceRecovery java Default JMSProvider gt lt properties gt Here the Recovery Manager attempts to recover JMS resources via the JMS Provider Loader Default JMSProvider Default JMSProvider ships with JBoss Enterprise Application Platform It is defined in JBOSS_HOME server PROFILE conf jms ds xml or in a clustered environment hajndi jms ds xm1 To perform recovery with a different JMS provider loader for example one that corresponds with a remote JMS Provider add another line to the properties file and specify your remote provider instead of DefaultJMSProvider Your provider s name should be listed in its managed bean configuration file Each provider requires a unique name for example com arjuna ats jta recovery XAResourceRecovery JBMESSAGING1 com arjuna ats jta recovery XAResourceRecovery JBMESSAGING2 etc Recovery should work with any JMS provider that implements recoverable XAResources that is it properly implements XAResource recover For the Recovery Manager to recover from any node of the cl
88. topic This example shows a simple send and receive to a remote topic using a JMS client mdb This example demonstrates usage of an EJB2 1 MDB with JBoss Messaging ejb3mdb This example demonstrates usage of an EJB3 MDB with JBoss Messaging stateless This example demonstrates an EJB2 1 stateless session bean interacting with JBoss Messaging mab failure This example demonstrates rollback and redelivery occuring with an EJB2 1 MDB secure socket This example demonstrates a JMS client interacting with a JBoss Messaging server using SSL encrypted transport http This example demonstrates a JMS client interacting with a JBoss Messaging server tunneling traffic over the HTTP protocol web service This example demonstrates JBoss web service interacting with JBoss Messaging stateless clustered This example demonstrates a JMS client interacting with clustered EJB2 1 stateless session bean which in turn interacts with JBoss Messaging The example uses HAJNDI to lookup the connection factory bridge This example demonstrates using a message bridge It deploys a message bridge in JBoss AS which then proceeds to move messages from a source to a target queue servlet This example demonstrates how to use servlet transport with JBoss Messaging It deploys a servlet and a ConnectionFactory that uses the servlet transport 10 ordering group This example demonstrates using strict message ordering with JBoss Messaging It uses JBoss Messaging
89. urs e g database connection is lost allowing other nodes to continue work The default value is false ServerPeerlD The unique identifier of the ServerPeer Each node deployed must have a unique identifier whether the nodes form a cluster or are linked by a message bridge The identifier must be a valid integer DefaultQueueJNDIContext The default JNDI context to be used when binding queues The default value is queue DefaultTopicJNDIContext The default JNDI context to be used when binding topics The default value is topic PostOffice The post office used by the ServerPeer You will not normally need to edit this attribute The post office routes messages to queues and maintains the mapping between queues and addresses DefaultDLO The default DLQ Dead Letter Queue that the server uses for destinations You can override the DLQ on a per destination basis For more information about destinations refer to Section 5 9 Configuring Destinations A DLQ is a destination for messages that the server has failed to deliver more than a certain number of times If the DLQ is not specified the message will be removed after the maximum number of delivery attempts You can specify a global default for the maximum number of delivery attempts with the DefaultMaxDeliveryAttempts attribute or set the maximum individually on a per destination basis 15 Chapter 5 Configuration DefaultMaxDeliveryAttempts The global default for the max
90. uster you must add a line in hajndi jms ds xml for every node of the cluster 55 56 Chapter 8 JBoss Messaging Message Bridge Configuration 8 1 Message Bridge Overview JBoss Messaging includes a fully functional message bridge The bridge consumes messages from a source queue or topic and sends them to a target queue or topic typically on a different server The source and target servers do not need to be in the same cluster so bridging is a reliable method of sending messages from one cluster to another across a WAN for example and where the connection may be unreliable A bridge is deployed as a managed bean within any JBoss Enterprise Application Platform instance To deploy add the managed bean descriptor into the deploy directory of an Enterprise Application Platform configuration that contains JBoss Messaging The example in JBOSS_HOME docs examples jboss messaging examples bridge demonstrates a simple bridge deployed in JBoss Enterprise Application Platform and moving messages from the source to the target destination The bridge can also be used to retrieve messages from other non JBoss Messaging JMS servers as long as they are JMS 1 1 compliant The bridge has built in failure recovery if the source or target server connection is lost the bridge will attempt to reconnect to the source or target until it comes back online at which point normal operation will resume The bridge can be configur
91. ustered installations If load balancing is enabled any connection created by that connection factory will be load balanced across the nodes of a cluster A connection created on a particular node remains on that node The default value is false 44 ConnectionFactory Managed Bean Attributes SupportsFailover Specifies whether client side automatic failover is enabled for the connection factory on clustered installations If automatic failover is enabled JBoss Messaging will automatically and transparently failover to another node in the cluster when a connection problem is detected The default value is false When automatic failover is disabled the user code is responsible for catching connection exceptions in synchronous JMS operations and a JMS ExceptionListener must be installed to catch exceptions asynchronously When an exception is caught the client side code must lookup a new connection factory via HAJNDI and recreate the connection DisableRemotingChecks Specifies whether the connection factory checks that the corresponding JBoss Remoting Connector uses sensible values JBoss Messaging is very sensitive to these values and there is rarely any need to change them To disable this sanity checking set DisableRemotingChecks to false The default value is true Ab Warning NN Do not disable the remoting checks system instability LoadBalancingFactory Specifies the client side load balancing factory implementation used
92. ustered connection factory which is bound into the following JNDI contexts ClusteredConnectionFactory e ClusteredXAConnectionFactory java ClusteredConnectionFactory java ClusteredXAConnectionFactory If you want to provide a default client ID for a connection factory or bind a connection factory to a different JNDI locationConsider then configure and deploy additional connection factories To deploy a new connection factory configure a new ConnectionFactory managed bean in connection factories service xml You can also create a new service deployment descriptor name service xml and deploy it in JBOSS HOME server messaging deploy Enable support for automatic failover or load balancing by setting the relevant attributes in your connection factory Example 5 1 Connection Factory This example connection factory creates a connection factory with the preconfigured client ID myClientID which is bound to two locations in the JNDI tree MyConnectionFactory and factories cf The example overrides the following default values PreFetchSize e DefaultTempQueueFullSize DefaultTempQueuePageSize DefaultTempQueueDownCacheSize 42 ConnectionFactory Managed Bean Attributes DupsOKBatchSize e SupportsFailover e SupportsLoadBalancing LoadBalancingFactory The connection factory uses the default remoting connector To use a different remoting connector with the connection factory change the Conne
93. vice attribute contains a different clustered attribute If set to false default all messages are reserved A Warning Redeployment Considerations When you re deploy a destination you must shut down all the nodes in the cluster make proper configuration changes and then restart the nodes Redeploying from a non clustered to a clustered queue requires you set the clustered attribute to true and add the queue service configuration to each node Redeploying from a clustered to a non clustered queue requires you set the clustered attribute to false in one of the queue configurations and delete all other queues in the cluster AllSubscriptionsCount Returns a count of all subscriptions belonging to this topic 39 Chapter 5 Configuration DurableSubscriptionsCount Returns a count of all durable subscriptions belonging to this topic NonDurableSubscriptionsCount Returns a count of all non durable subscriptions belonging to this topic 5 9 3 1 1 Destination Security Configuration lt SecurityConfig gt determines which roles can read write and create upon the destination It uses the same syntax and semantics as JBossMQ destination security configuration The lt SecurityConfig gt element must contain one security element which can contain multiple role elements A role element defines the access type for that particular role using the following attributes read Specifies the role can create consumers rece
94. wnCacheSize gt 1000 lt attribute gt attribute name DupsOKBatchSize gt 10000 lt attribute gt lt mbean gt 5 10 1 ConnectionFactory Managed Bean Attributes ClientID You can preconfigure a connection factory with a client ID Any connection created via this connection factory will obtain this client ID 43 Chapter 5 Configuration JNDIBindings Lists available JNDI bindings for this connection factory PrefetchSize Specifies how many messages the window holds at once for consumer flow control The window size determines the number of messages a server can send to a consumer without blocking Each consumer maintains a buffer of messages from which it consumes Transmission Control Protocol TCP implements its own additional flow control Message consumption can also be blocked if the TCP window size is smaller than the PrefetchSize parameter SlowConsumers Specifies whether the allowable buffer size for slow consumers is reduced Reducing the buffer size for slow consumers results in minimized to increase the potential for messages to be consumed by faster consumers It is not possible to totally disable buffering however setting the SlowConsumers attribute to true will reduce the buffer size Setting this attribute to true is equivalent to setting PrefetchSize to 1 which is the lowest possible value available Strict Tck Enables strict JMS behavior if the attribute is set to true Strict JMS behavior is required b
95. y the Technology Compatibility Kit TCK SendAcksAsync Specifies acknowledgments are sent asynchronously if the attribute is set to true This can improve performance particularly if auto acknowledge mode is active DefaultTempQueueFullSize Optional attribute that specifies the paging parameters for temporary full size queue destinations which are scoped to connections created with this connection factory The default value is 200000 For more information about these attributes refer to Section 5 9 3 1 2 Destination paging parameters DefaultTempQueuePageSize Optional attribute that specifies the paging parameters for temporary page size destinations which are scoped to connections created with this connection factory The default value is 2000 For more information about these attributes refer to Section 5 9 3 1 2 Destination paging parameters DefaultTempQueueDownCacheSize Optional attribute that specifies the paging parameters for temporary down cache size destinations which are scoped to connections created with this connection factory The default value is 2000 For more information about these attributes refer to Section 5 9 3 1 2 Destination paging parameters DupsOKBatchSize Specifies the number of DUPS OK ACKNOWLEDGE acknowledgments that are buffered locally before they are sent The default value is 2000 SupportsLoadBalancing Specifies whether client side load balancing is enabled for the connection factory on cl
96. yLimit JBoss Messaging provides a message counter history which shows the number of messages arriving on each queue over a certain number of days This attribute represents the maximum number of days for which to store message counter history You can override this value on a per destination ClusterPullConnectionFactoryName The connection factory used to pull or suck messages between queues You can omit this attribute to disable message sucking while retaining failover DefaultPreserveOrdering When true JMS ordering is preserved in the cluster See Chapter 6 Clustering Notes for more detail The default value is false RecoverDeliveriesTimeout When failover occurs messages that have been delivered will be stored while the clients reconnect If the clients do not reconnect for example if the client is dead these messages will eventually time out and be added to the queue This attribute sets the period before timeout in milliseconds The default value is 300000 five minutes EnableMessageCounters When set to true enables message counters upon server start SuckerPassword JBoss Messaging internally creates connections between nodes to redistribute messages between clustered destinations These connections are created with a special reserved username This attribute defines the password to use when creating these connections 16 ServerPeer methods For versions of JBoss Messaging later than 1 4 1 GA you must defi

Download Pdf Manuals

image

Related Search

Related Contents

2008 8 Inch Spanish RP Type Pool Manual Combined.indd  Thermostat with Touch and Wireless Connectivity  Samsung RT34SSIS User Manual  Le montage virtuel, les procédures de post-production  HP CloudSystem Matrix    Franke BFX 710  PDF-Bedienungsanleitung  Getting Started  1522521-EN-FR (Web)  

Copyright © All rights reserved.
Failed to retrieve file