Home

HornetQ large messages

image

Contents

1. boss profile deploy hornetq hornetq configuration xml hornetq jms xml HornetQ configuration in JBoss EAP 6 x jboss standalone configuration standalone xml jboss domain configuration domain xml JBoss HornetQ in EAP 6 oy Red Hat lt security settings gt lt security setting match gt permission type send roles guest gt lt permission type consume roles guest gt permission type createNonDurableQueue roles guest permission type deleteNonDurableQueue roles guest gt lt security setting gt lt security settings gt lt address settings gt lt address setting match gt lt dead letter address gt jms queue DLQ lt dead letter address gt lt expiry address gt jms queue ExpiryQueue lt expiry address gt lt redelivery delay gt 0 lt redelivery delay gt lt max size bytes gt 10485760 lt max size bytes gt lt address full policy gt BLOCK lt address full policy gt security addressing lt message counter history day limit gt 10 lt message counter history day limit gt lt address setting gt lt address settings gt JBoss HornetQ in EAP 6 oy Red Hat lt jms connection factories gt connection factory name InVmConnectionFactory gt lt connectors gt lt connector ref connector name in vm q lt connectors gt connection factories lt entries gt lt entry name java ConnectionFactory gt lt entries gt l
2. ch servers in the cluster are up at any one time Other servers Servers in a cluster want to be able to create cluster connections to each other without having prior knowledge of all the other servers in the cluster Server discovery uses User Datagram Protocol UDP multicast to broadcast server connection settings JBoss HornetQ clusterin oy Red Hat hornetq configuration xml lt discovery groups gt lt discovery group name my discovery group gt lt local bind address gt 172 16 9 7 lt local bind address gt lt group address gt 231 7 7 7 lt group address gt lt group port gt 9876 lt group port gt lt refresh timeout gt 10000 lt refresh timeout gt lt discovery group gt lt discovery groups gt lt connection factory name ConnectionFactory gt lt discovery group ref discovery group name my discovery group gt lt entries gt entry name ConnectionFactory gt lt entries gt lt connection factory gt oe JBoss HornetQ clustering In case the connection is not downloaded by JNDI final String groupAddress 231 7 7 7 final int groupPort 9876 ConnectionFactory jmsConnectionFactory HornetQJMSClient createConnectionFactory groupAddress groupPort Connection jmsConnectionl jmsConnectionFactory createConnection Connection jmsConnection2 jmsConnectionFactory createConnection Se HornetQ clustering Server Side load balancing hornetq configuration xml lt clu
3. define how it connects to a server hornetq configuration xml connector name netty gt lt factory class org hornetq core remoting impl netty NettyConnectorFactory fact ory class gt param key host value jboss bind address localhost gt param key port value hornetg remoting netty port 5445 gt lt connector gt oe e OSS aire HornetQ persistence HornetQ handles persistence with a high performance journal which is optimized for messaging specific use cases The HornetQ journal is append only with a configurable file size which improves performance by enabling single write operations It consists of a set of files on disk which are initially pre created to a fixed size and filled with padding As server operations add message delete message update message etc are performed records of the operations are appended to the journal until the journal file is full at which point the next journal file is used oe 9 Oss aire HornetQ persistence configuration in hornetq configuration xml journal directory location of the message journal default value is data journal Journal type valid values are NIO or ASYNCIO If NIO the Java NIO Journal is used If ASYNCIO Linux asynchronous IO is used If ASYNCIO is set on a non Linux or non libaio system HornetQ detectsthis and falls back to NIO journal sync transactional If true HornetQ ensures all transaction data
4. entries gt entry name ConnectionFactory lt entries gt lt consumer window size gt 0 lt consumer window size gt lt connection factory gt s Boss HornetQ flow control It is also possible to control the rate at which a consumer can consume messages This can be used to make sure that a consumer never consumes messages at a rate faster than the rate specified lt connection factory name ConnectionFactory gt lt connectors gt lt connector ref connector name netty connector lt connectors gt lt entries gt entry name ConnectionFactory lt entries gt lt consumer max rate gt 10 lt consumer max rate gt lt connection factory gt s Boss HornetQ flow control Itis possible to manage the flow control even for producers HornetQ also can limit the amount of data sent from a client to a server to prevent the server being overwhelmed connection factory name NettyConnectionFactory gt connectors connector ref connector name netty connector lt connectors gt lt entries gt entry name ConnectionFactory lt entries gt lt producer window size gt 10 lt producer window size gt lt connection factory gt oe e s Boss HornetQ message redelivery An undelivered message returns to the queue ready to be redelivered There are two options for these undelivered messages Delayed Redelivery Message delivery can be delayed to allow the client time to rec
5. h limited memory In such a situation its not possible to store all of the gueues in memory at one time so HornetO transparently pages messages in and out of memory as they are needed This allows massive queues with a low memory footprint HornetQ will start paging messages to disk when the size of all messages in memory for an address exceeds a configured maximum size By default HornetQ does not page messages this must be explicitly configured to activate it JBoss JBoss ee by Red Hat HornetQ paging hornetq configuration xml lt paging directory gt somewhere paging directory lt paging directory gt lt address settings gt lt address setting match ms someaddress gt lt max size bytes gt 104857600 lt max size bytes gt lt page size bytes gt 10485 760 lt page size bytes gt lt address full policy gt PAGE lt address full policy gt lt address setting gt lt address settings gt Address full policy PAGE further messages will be paged to disk DROP then further messages will be silently dropped BLOCK then client message producers will block when they try and send further messages JBoss HornetO high availabilty by Red Hat HornetQ allows pairs of servers to be linked together as live backup pairs A backup server is owned by only one live server Backup servers are not operational until failover occurs When a live server crashes or is brought down in the correct mode the backup
6. is flushed to disk on transaction boundaries commit prepare and rollback default is true JBoss HornetQ persistence journal file size size of each journal file in bytes default value is 10485760 bytes 10 megabytes journal min files minimum number of files the journal maintains journal max lo maximum number of write requests to hold in the IO queue Write reduests are dueued here before being submitted to the system for execution If the queue fills writes are blocked until Space becomes available in the queue journal compact min files minimum number of files before the journal will be compacted default value is 10 JBoss HornetQ flow control oy RedHat Flow control is used to limit the flow of data between a client and server or a server and another server It does this in order to prevent the client or server being overwhelmed with data Consumer flow control HornetQ consumers improve performance by buffering a certain number of messages in a client side buffer before passing them to be consumed By default the consumer window size is set to 1 MIB The value can be e 1 for an unbound buffer e 0 to not buffer any messages gt 0 for a buffer with the given maximum size in bytes s Boss HornetQ flow control configuration in hornetq jms xml connection factory name ConnectionFactory gt connectors connector ref connector name netty connector lt connectors gt lt
7. n xmlns urn hornetq xmlns xsi http www w3 0rg 2001 XML Schema instance xsi schemaLocation urn hornetq schema hornetq configuration xsd lt large message directory gt data large messages lt large message directory gt lt configuration gt hornetq jms xml lt connection factory name ConnectionFactory gt lt connectors gt connector ref connector name netty gt lt connectors gt lt entries gt entry name ConnectionFactory entry name XAConnectionFactory lt entries gt lt min large message size gt 250000 lt min large message size gt lt connection factory gt e e s Boss HornetQ large messages hornetq configuration xml configuration xmlns urn hornetq xmlns xsi http www w3 0rg 2001 XML Schema instance xsi schemaLocation urn hornetq schema hornetq configuration xsd lt large message directory gt data large messages lt large message directory gt lt configuration gt hornetq jms xml lt connection factory name ConnectionFactory gt lt connectors gt connector ref connector name netty gt lt connectors gt lt entries gt entry name ConnectionFactory entry name XAConnectionFactory lt entries gt lt min large message size gt 250000 lt min large message size gt lt connection factory gt oe e Oss se rr HornetQ paging HornetO transparently supports huge dueues containing millions of messages while the server is running wit
8. nally Each HornetQ server has its own ultra high performance persistent journal which it uses for messaging and other persistence Using a high performance journal allows persistence message performance which is something not achievable when using a relational database for persistence e i JBoss HornetQ modes HornetQ currently provides two APIs for messaging at the client side Core client API simple intuitive Java API that allows the full set of messaging functionality without some of the complexities of JMS JMS client API standard JMS API JMS semantics are implemented by a thin JMS facade layer on the client side The HornetQ server does not associate with JMS and does not know anything about JMS It is a protocol agnostic messaging server designed to be used with multiple different protocols When a user uses the JMS API on the client side all JMS interactions are translated into operations on the HornetQ core client API before being transferred over the wire using the HornetQ wire format eg by Red Hat HornetQ modes HornetQ server persistent journal x network t core client core client JMS facade user user application 1 application 2 JBoss HornetO in EAP oy RedHat JBoss EAP 5 1 x not the default messaging system easy to switch from JBM to HornetQ JBM or HornetQ not together JBoss EAP 6 x default JMS implementation HornetQ configuration in JBoss EAP 5 1 x j
9. oe JBoss L3 by Red Hat Faster amp Greater Messaging System HornetQ zzz Giovanni Marigi gmarigi at redhat com Middleware Consultant JBoss a Division of Red Hat HornetQ JBoss Agenda by Red Hat O O O Intro Core EAP and standalone Transport Persistence amp large messages Flow control Clustering amp High Availability Other features JBoss NS Some stats HornetQ sets a record breaking score in the SPECjms2007 industry standard benchmark for JMS messaging system performance HornetQ 2 0 GA obtained scores up to 307 higher than previously published SPECjms2007 benchmark results on the same server hardware and operating system set up The peer reviewed results are available on the spec org web site www spec org jms2007 results jms2007 html 8 2 messages per second with SpecJMS http planet jooss org post 8 2 million messages second with specjms The results were obtained by Kai Sachs and Stefan Appel from an independent research group at the TU Darmstadt Germany Their release announcement can be found here www dvs tu darmstadt de news specjms2007Results_HornetQ html oe s Boss HornetQ core HornetQ core is designed simply as a set of POJOs It has also been designed to have as few dependencies on external jars as possible As a result HornetQ core has only one more jar dependency than the standard JDK classes netty jar netty buffer classes are used inter
10. onFactory hornetq connectors jms xml connector ref connector name netty connector gt lt connectors gt lt entries gt entry name ConnectionFactory gt lt entries gt lt group id gt Group O lt group id gt lt connection factory gt s Boss HornetQ other features Diverts Diverts are objects that transparently divert messages routed to one address to some other address without making any changes to any client application logic Diverts can also be configured to apply a Transformer An exclusive divert diverts all matching messages that are routed to the old address to the new address Matching messages do not get routed to the old address hornetq configuration xml divert name prices divert gt lt address gt jms topic priceUpdates lt address gt lt forwarding address gt jms queue priceForwarding lt forwarding address gt lt filter string office New York gt lt transformer class name gt org hornetg jms example AddForwardingTimeTransformer lt transformer class name gt lt exclusive gt true lt exclusive gt lt divert gt s Boss HornetQ other features Diverts Non exclusive diverts forward a copy of a message to a new address allowing the original message to continue to the previous address hornetq configuration xml divert name order divert gt lt address gt jms queue orders lt address gt lt forwarding address gt jms topic spy Topic lt forwarding address gt l
11. over from transient failures and not overload its network or CPU resources Dead Letter Address Configure a dead letter address to which messages are sent after being determined undeliverable oe e s Boss HornetQ message redelivery address setting match ms queue exampleQueue gt lt redelivery delay gt 5000 lt redelivery delay gt lt address setting gt lt address setting match ms queue exampleQueue gt lt dead letter address gt jms queue deadLetterQueue lt dead letter address gt lt max delivery attempts gt 3 lt max delivery attempts gt lt address setting gt oe i s Boss HornetQ large messages HornetQ supports sending and receiving of large messages even when the client and server are running with limited memory As the InputStream is read the data is sent to the server as a stream of fragments The server persists these fragments to disk as it receives them When the time comes to deliver them to a consumer they are read back off the disk also in fragments and sent down the wire When the consumer receives a large message it initially receives just the message with an empty body It can then set an OutputStream on the message to stream the large message body to a file on disk or elsewhere At no time is the entire message body stored fully in memory either on the client or the server e e s Boss HornetQ large messages hornetq configuration xml configuratio
12. ress lt expired messages in exampleQueue will be sent to the expiry address expiryQueue gt lt address setting match jms queue exampleQueue gt lt expiry address gt jms queue expiryQueue lt expiry address gt lt address setting gt s Boss HornetQ other features Scheduled messages TextMessage message session create TextWMessage MSG message setLongProperty HQ SCHED DELIVERY System currentTimeMIillis 5000 producer send message message will not be received immediately but 5 seconds later TextMessage messageReceived TextMessage consumer receive Message group Message groups are sets of messages that have the following characteristics Messages in a message group share the same group id that is they have the same group identifier property JMSXGroupID for JMS HQ GROUP ID for HornetQ Core API Messages in a message group are always consumed by the same consumer even if there are many consumers on a queue They pin all messages with the same group id to the same consumer If that consumer closes another consumer is chosen and will receive all messages with the samegroup id s Boss HornetQ other features Based on message Message message message setStringProperty JMSXGroupID Group 0O producer send message message message setStringProperty JMSXGroupID Group 0 producer send message Based on connection factory connection factory name Connecti
13. send message if connection null 1 connection close y I IZero code change from JBM TransactionAttribute value TransactionAttributeType REQUIRED public void onMessage Message message C jms consumer ObjectMessage obj ObjectMessage message try 1 Serializable ser obj getObject log info NotificationInbound onMessage catch Exception e log error NotificationInbound ERROR e getMessage throw new IllegalStateException JBoss HornetQ standalone by Red Hat hornetq bin config jboss as 4 jboss as 5 stand alone docs ap L auickstart guide user manual examples core javaee jms lib licenses schemas JBoss HornetQ transport HornetQ has a fully pluggable and highly flexible transport layer The transport layer defines its own Service Provider Interface SPI to simplify plugging in a new transport provider Netty TCP Netty SSL Netty HTTP Netty Servlet acceptors are used on the server to define how connections are accepted hornetq configuration xml acceptor name netty gt lt factory class gt org hornetq core remoting impl netty NettyAcceptorFactory lt factory class gt param key host value jboss bind address localhost gt param key port value S hornetq remoting netty port 5445 gt lt acceptor gt JBoss HornetQ transport connectors are used by a client to
14. server currently in passive mode will become live and another backup server will become passive If a live server restarts after a failover then it will have priority and be the next server to become live when the current live server goes down if the current live server is configured to allow automatic failback then it will detect the live server coming back up and automatically stop D eS e f e JBoss e oy RedHat HornetQ high availabilty configure the live and backup server to share their store configure both hornetq configuration xml lt shared store gt true lt shared store gt Additionally the backup server must be flagged explicitly as a backup lt backup gt true lt backup gt In order for live backup pairs to operate properly with a shared store both servers must have configured the location of journal directory to point to the same shared location ee A HornetQ clustering HornetQ clusters allow groups of HornetQ servers to be grouped together in order to share message processing load Each active node in the cluster is an active HornetQ server which manages its own messages and handles its own connections hornetq configuration xml for each node set the parameter clustered to true Server discovery is a mechanism by which servers can propagate their connection details to Messaging clients A messaging client wants to be able to connect to the servers of the cluster without having specific knowledge of whi
15. ster connections gt lt cluster connection name my cluster gt lt address gt jms lt address gt lt retry interval gt 500 lt retry interval gt lt use duplicate detection gt true lt use duplicate detection gt lt forward when no consumers gt false lt forward when no consumers gt lt max hops gt 1 lt max hops gt discovery group ref discovery group name my discovery group gt lt cluster connection gt lt cluster connections gt pies HornetQ clustering Client Side load balancing hornetq jms xml lt connection factory name ConnectionFactory gt discovery group ref discovery group name my discovery group entries entry name ConnectionFactory gt lt entries gt lt ha gt true lt ha gt lt connection load balancing policy class name gt org hornetq api core client loadbalance RandomConnectionLoadBalancingPolicy lt connection load balancing policy class name gt lt connection factory gt oe s Boss HornetQ other features Routing messages with wildcards e g queue is created with an address of queue news queue news europe or queue news usa or queue news usa sport Message expire HornetO will not deliver a message to a consumer after it s time to live has been exceeded If the message hasn t been delivered before the time to live is reached the server can discard it message will expire in 5000ms from now message setExpiration System currentTimeMillis 5000 Expiry add
16. t connection factory gt lt connection factory name RemoteConnectionFactory gt lt connectors gt connector ref connector name netty gt lt connectors gt lt entries gt entry name java jboss exported jms RemoteConnectionFactory gt lt entries gt lt connection factory gt JBoss HornetQ in EAP 6 oy RedHat pooled connection factory name hornetq ra transaction mode xa connectors connector ref connector name in vm lt connectors gt lt entries gt entry name java JmsXA gt lt entries gt lt pooled connection factory gt lt jms connection factories gt 4 jmsdestinations lt jms destinations gt lt jms queue name notificationQueue gt entry name queue notificationQueue gt lt jms queue gt lt jms destinations gt lt hornetg server gt JBoss HornetQ in EAP 6 Red Hat public void sendToQueue String destinationName Serializable payload throws Exception InitialContext ic new InitialContext ConnectionFactory cf ConnectionFactory ic lookup ConnectionFactory Queue queue Queue ic lookup destinationName Connection connection cf createConnection Session session connection createSession false Session AUTO ACKNOWLEDGE MessageProducer publisher session createProducer queue connection start a jms producer ObjectMessage message session createObjectMessage payload message setObject payload publisher
17. t exclusive gt false lt exclusive gt lt divert gt oe JBoss L3 by Red Hat Faster amp Greater Messaging System HornetQ zzz THANKS HornetQ

Download Pdf Manuals

image

Related Search

Related Contents

Samsung GT-M8910 Manuel de l'utilisateur  11.400 NEGRO BETÚN JUDAICO "CINCO AROS"      Cornelius Pressurized Liquid Base Beverage Dispense User's Manual  Estufa Patio  取扱説明書  Sony Receiver STR-DE698 S  tipo VM552 630 - TECNEL NOVELLARA  同(オ-ドライブシステム  

Copyright © All rights reserved.
Failed to retrieve file