ActiveMQ practice the road (four) ActiveMQ 4.x + JBoss 4.x MDP actual articles
At <<ActiveMQ实践之路(三) ActiveMQ 4.x +JBoss 4.x整合篇>> which we compare in detail the ActiveMQ with JBoss integration Now that the selection JBoss, then the project will use more or less inside the EJB, the following we will introduce in detail how to ActiveMQ 4.x + JBOSS 4.x development environment Message Driven Bean, and with the use of configuration jbossMQ made at a more detailed comparison. OrderMessage here is just a auto-generated Message Driven Bean, which in the onMessage method for log input.
1. Configure ejb-jar.xml
1. Ejb-jar.xml should not use XML DTD, required the use of XML Schema (XSD) Many of my friends might use XDoclet to generate ejb-jar.xml, me here directly using XDoclet to generate the ejb-jar.xml are
<! - CTYPE ejb-jar PUBLIC "- / / Sun Microsystems, Inc. / / DTD Enterprise JavaBeans 2.0 / / EN" "http://java.sun.com/dtd/ejb-jar_2_0.dt-->
But in between ActiveMQ + JBoss configuration required to use the new XML Schema in order to complete the definition of ra, as follows.
One of destination, destinationType are provided configuration ra.xml inside the property, (here the official documents are Destination, DestinationType, and in fact activemq-ra.rar are ra.xml inside the destination, destinationType, pay attention to the difference between upper and lower case)
II. Jboss.xml configuration Most configurations are at jboss.xml inside. 1. JBossMQ and use of the use of ActiveMQ RA configure Message Driven Bean distinction 1.) Use JBossMQ configuration
Three. Medium at Servlet by sending a message to verify the above Message Driven Bean
In order to be able to verify this MessageDrivenBean normal job, I use a very simple servlet send a message to the queue, the former one of the activemq-ds.xml already provided at boot time bind the JNDI activemq / QueueConnectionFactory, activemq / queue / outbound, We used directly on the list,
Iv. Topic about durable subscriptions to a supplementary explanation of the use of durable manner, you need at ejb-jar.xml in the extra configuration, subscriptionDurability, clientId, subscriptionName
EJB3 persistence with Hibernate is very similar to the mechanism: Environment: Server: JBOSS5.0 Database: MySQL5.0 1. Set up a data source First of all, in jboss-5.0.0.GA \ server \ default \ deploy, ...
Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to ...
Hibernate cache level: (1) a cache is very short and the session life cycle consistent, also known as session-level cache-level cache or transaction-level cache (2) Ways of Supporting level cache: get ...