Use ActiveMQ as the JMS provider and write a simple demo.The main is to simulate the appearance of a chat room, the following is the source codePackagecom.mycompany.app;importjava.io.bufferedreader;importjava.io.inputstreamreader;import javax.jms.JMSException;importjavax.jms.Message;importjavax.jms.MessageListener;import javax.jms.session;importjavax.jms.textmessage;importjavax.jms.topic;import javax.jms.topicconnection;importjavax.jms.topicpublisher;
I. Opening Speech
Following the previous experience of apache ActiveMQ, we have been reviewing spring recently. Therefore, this article uses spring to integrate JMS.
2. Prepare the environment
1. ActiveMQ5.2.0 (activemq-all-5.2.0.jar)
2. spring2.5 (spring. jar)
3. JavaEE5
4. JDK1.6
Note: Start the ActiveMQ server before testing.
Iii. Code testing (P2P)
1. MsgSender: Message producer
/** * message sender */public class MsgSender {public static vo
Original address: http://blog.csdn.net/shimly2010/article/details/9748223
Reference Documentation:http://haohaoxuexi.iteye.com/blog/1893038Http://www.blogjava.net/chenhui7502/archive/2011/08/28/357457.html
Most of the online articles about spring and Apache integration are rarely used in TIBCO EMS. Follow the spring JMS Standard, after referencing the two articles, do a demo run Tibco EMS. Can run.1. Import Jar Pack
2. Configuration file [HTML] View P
Bit crossing, because the queue operation is relatively simple, I say nothing, directly on the code, welcome to verify!!!#pragma Mark--abstractThe //queue is a linear table that allows insertions at one end of the table, and deletes at the other end of the table, allowing the inserted end to be called the tail of the team (rear)//Allow deletion of one end called the team header (font), the
The array implementation of the queue, from the end of the team into, the enemy deleted.Queue Length with the flag variable size, which is a variable independent of front and rear. Size = = 0, the queue is empty. Size = = capacity, full queue.I. Statement of statements 1 struct node{ 2 int capacity; 3 int Front; 4 int Rear; 5 int Size; 6 int * Array; 7 }; 8 typedef struct Node
The PHP Data structure queue (SplQueue) and the priority queue (SplPriorityQueue) are simple to use instances, and the priority queue data structure. PHP Data structure queue (SplQueue) and priority queue (SplPriorityQueue) are simple to use instances. The data structure of
Queue /QueueArray queueArray queue is an array-based implementation of the queue, its implementation is similar to the array stack, is a FIFO linear data structure.Queue: The following will use the list in Python instead of the array in the C language to implement the data structure of the array queue.Note: The implementation here does not apply a fixed-si
JPA
Java persistence API.
JPA uses JDK 5.0 annotations or XML to describe the ing relationship between objects and Relational Tables, and persistently stores object objects in the database at runtime.
Baidu Encyclopedia: http://baike.baidu.com/view/1036852.htm
JTA
Java transaction API, translated as Java transaction API.
JTA allows applications to execute Distributed Transaction Processing-accessing and updating data on two or more network computer resources. The JTA support of the JDBC driver
SPRINGMVC + Mybatis + springsecurity (Permission control to method button) + Rest (service) + Webservice (service) + Quartz (timed dispatch) + Lucene (search engine) + HTML5 Bootstrap + Maven Project to build an absolute open source platformProject Mave Construction, simulation of large-scale Internet architecture, to achieve high concurrency, large data processing, the entire project using customized service ideas, to provide an atomic, modular scheme, the function module is split, can be commo
Today, my colleague asked me how to handle the JMS messages of receive and visible. A little bit ignorant, before the state of the message has never been concerned. In the Weblogic81, we can't see the message in destination, we can only see how many messages there are in the current destination, how many pending are there. And in 92, when we monitor the destination, we can see the specific message, and the message follows a state string. The title of
Session session = Connection.createsession (PARAMA,PARAMB);
Parama is set transaction, PARAMB is set acknowledgment mode
Parama values are:
1. True: Support transactions
When true: The value of PARAMB is ignored, acknowledgment mode is set to session_transacted by the JMS server.
2. False: Transaction not supported
When false: The value of Paramb can be one of Session.auto_acknowledge, Session.client_acknowledge, Dups_ok_acknowledge.
Paramb val
The JMS API defines five types of message bodies:
--------------------------------------------------------------------------------------------------------------- ----Stream-The message body of the Streammessage object contains the Java programming language primitive value stream ("Java basic type"). Populate and read sequentially.Map-The message body of the Mapmessage object contains a set of name-value pairs, where the name is a String object and th
Ack_mode Confirm Mode
--------------------------------------------------------------------------------------------------------------- -----The confirmation mode is used to indicate how the session confirms receipt of the message, which needs to be specified when using the connection CreateSession method, and the following four options are included in the JMS session interface· Auto_acknowledge = 1 Automatic ConfirmationThe session automatically confi
Exception Information:Exception is Java.lang.IllegalStateException:Cannot convert value of type [ Org.springframework.data.redis.connection.jedis.JedisConnectionFactory] to required type [ Javax.jms.ConnectionFactory] for property ' connectionfactory ': no matching editors or conversion strategy found
Because the project needs to integrate Redis and JMS, when the start times are wrong. It is suggested that the interface to implement the class impleme
PHP data Structure Queue (Splqueue) and Priority queue (Splpriorityqueue) Simple usage instance, priority queue data structure
Queue this data structure is simpler, just like in our lives, it is characterized by FIFO.
The Splqueue class in PHP SPL is the implementation of queue
This work is licensed with the knowledge sharing signature-non-commercial use-sharing 2.5 Chinese mainland license agreement in the same way.
Reprint please indicate the source and author. http://blog.csdn.net/xtj332
Background: There are a lot of messages in Message Queuing that need to be processed, and the business logic in the Listener OnMessage () method is relatively complex, in order to speed up the reading and processing of queue messages. Can
1, Singleconnectionfactory: The request to establish a JMS server link will always return the same link, and the Close method call of connection will be ignored. ( org.springframework.jms.connection. singleconnectionfactory)2, Cachingconnectionfactory: inherited the singleconnectionfactory, so it has all the functions of singleconnectionfactory, and it also added a cache function, It can cache sessions, MessageProducer, and Messageconsumer. We use Cac
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.