There are too few documents about this bird thing. errors are often reported during multithreading. errors may be reported during sending and receiving. No errors are reported on others' computers, and errors are prone to errors on my computer. In addition, a socketexception is thrown. The built-in thread pool only uses one activemqconnection. After a network error is detected, the connection is directly closed. The External Thread Pool packaging does not return the Connection check if it is closed, resulting in an error message interruption.
At the beginning, I added the close check myself. If an error occurs in the connection pool, the new connection will be returned. In this way, messagelistener also needs to be re-registered. The strange thing is that the exception processor registered in the session is actually effective ....
Later, the activemq Forum experts told me to use the automatic reconnection function: reliable: TCP: // host: Port as the URL, faint, it seems that the document is used to switch between multiple URLs.
Before the reply, I tried their 4.0m2 version. This version was greatly changed and encountered the following problems:
1. Spring support is gone. Start as follows:
Broker = org. activemq. Broker. brokerfactory. createbroker (New uri (
"Broker :( TCP: // localhost: 61616 )? Persistent = false "));
Broker. Start ();
2. For URL rule changes, see.
3. Different errors occur during multithreading. When the pooledsession is closed, the following error is reported: pool closed.
After checking, it is found that the pooledconnection. Close () method adds a sufficient way to disable the shared cache. It works normally after being commented out.
4. Automatic reconnection URL: failover: TCP: // host: Port
Version 4.0 is very fast after startup. It seems that there was no time for DNS resolution in the past.