@@ -24,17 +24,16 @@ usual (Spring) POJOs. Currently, Spring supports the following remoting technolo
2424
2525* *Remote Method Invocation (RMI)*: Through the use of `RmiProxyFactoryBean` and
2626 `RmiServiceExporter`, Spring supports both traditional RMI (with `java.rmi.Remote`
27- interfaces and `java.rmi.RemoteException`) and transparent remoting through RMI invokers
28- (with any Java interface).
27+ interfaces and `java.rmi.RemoteException`) and transparent remoting through RMI
28+ invokers (with any Java interface).
2929* *Spring's HTTP invoker*: Spring provides a special remoting strategy that allows
3030 for Java serialization though HTTP, supporting any Java interface (as the RMI
31- invoker does). The corresponding support classes are `HttpInvokerProxyFactoryBean` and
32- `HttpInvokerServiceExporter`.
31+ invoker does). The corresponding support classes are `HttpInvokerProxyFactoryBean`
32+ and `HttpInvokerServiceExporter`.
3333* *Hessian*: By using Spring's `HessianProxyFactoryBean` and the
3434 `HessianServiceExporter`, you can transparently expose your services through the
3535 lightweight binary HTTP-based protocol provided by Caucho.
36- * *JAX-WS*: Spring provides remoting support for web services through JAX-WS (the
37- successor of JAX-RPC, as introduced in Java EE 5 and Java 6).
36+ * *JAX-WS*: Spring provides remoting support for web services through JAX-WS.
3837* *JMS*: Remoting by using JMS as the underlying protocol is supported through the
3938 `JmsInvokerServiceExporter` and `JmsInvokerProxyFactoryBean` classes.
4039* *AMQP*: Remoting by using AMQP as the underlying protocol is supported by the Spring
@@ -627,7 +626,6 @@ and Spring's `@Autowired` configuration annotation is still honored):
627626 public List<Account> getAccounts(String name) {
628627 return biz.getAccounts(name);
629628 }
630-
631629 }
632630----
633631====
@@ -732,8 +730,8 @@ accordingly first. Check the JAX-WS documentation for details on those requireme
732730[[remoting-jms]]
733731=== Exposing Services through JMS
734732
735- You can also expose services transparently by using JMS as the underlying
736- communication protocol. The JMS remoting support in the Spring Framework is pretty basic.
733+ You can also expose services transparently by using JMS as the underlying communication
734+ protocol. The JMS remoting support in the Spring Framework is pretty basic.
737735It sends and receives on the `same thread` and in the same non-transactional
738736`Session`. As a result, throughput is implementation-dependent. Note that these
739737single-threaded and non-transactional constraints apply only to Spring's JMS
@@ -751,7 +749,6 @@ The following interface is used on both the server and the client sides:
751749 public interface CheckingAccountService {
752750
753751 public void cancelAccount(Long accountId);
754-
755752 }
756753----
757754====
@@ -769,13 +766,12 @@ The following simple implementation of the preceding interface is used on the se
769766 public void cancelAccount(Long accountId) {
770767 System.out.println("Cancelling account [" + accountId + "]");
771768 }
772-
773769 }
774770----
775771====
776772
777- The following configuration file contains the JMS-infrastructure beans that are shared on both
778- the client and server:
773+ The following configuration file contains the JMS-infrastructure beans that are shared
774+ on both the client and the server:
779775
780776====
781777[source,xml,indent=0]
@@ -846,7 +842,6 @@ On the server, you need to expose the service object that uses the
846842 public static void main(String[] args) throws Exception {
847843 new ClassPathXmlApplicationContext(new String[]{"com/foo/server.xml", "com/foo/jms.xml"});
848844 }
849-
850845 }
851846----
852847====
@@ -897,7 +892,6 @@ proxy takes care of forwarding the call to the server-side object via JMS):
897892 CheckingAccountService service = (CheckingAccountService) ctx.getBean("checkingAccountService");
898893 service.cancelAccount(new Long(10));
899894 }
900-
901895 }
902896----
903897====
@@ -916,8 +910,8 @@ Auto-detection is not implemented for remote interfaces
916910
917911The main reason why auto-detection of implemented interfaces does not occur for remote
918912interfaces is to avoid opening too many doors to remote callers. The target object might
919- implement internal callback interfaces, such as `InitializingBean` or `DisposableBean`, which
920- one would not want to expose to callers.
913+ implement internal callback interfaces, such as `InitializingBean` or `DisposableBean`
914+ which one would not want to expose to callers.
921915
922916Offering a proxy with all interfaces implemented by the target usually does not matter
923917in the local case. However, when you export a remote service, you should expose a specific
@@ -936,13 +930,13 @@ effort and puts you on the safe side regarding controlled exposure of specific m
936930[[remoting-considerations]]
937931=== Considerations when Choosing a Technology
938932
939- Each and every technology presented here has its drawbacks. When choosing a technology, you should carefully
940- consider your needs, the services you expose, and the objects you send
941- over the wire.
933+ Each and every technology presented here has its drawbacks. When choosing a technology,
934+ you should carefully consider your needs, the services you expose, and the objects you
935+ send over the wire.
942936
943937When using RMI, you cannot access the objects through the HTTP protocol,
944- unless you tunnel the RMI traffic. RMI is a fairly heavy-weight protocol, in that
945- it supports full-object serialization, which is important when you use a complex data model
938+ unless you tunnel the RMI traffic. RMI is a fairly heavy-weight protocol, in that it
939+ supports full-object serialization, which is important when you use a complex data model
946940that needs serialization over the wire. However, RMI-JRMP is tied to Java clients. It is
947941a Java-to-Java remoting solution.
948942
@@ -967,8 +961,8 @@ technologies.
967961Last but not least, EJB has an advantage over RMI, in that it supports standard
968962role-based authentication and authorization and remote transaction propagation. It is
969963possible to get RMI invokers or HTTP invokers to support security context propagation as
970- well, although this is not provided by core Spring. Spring offers only appropriate hooks for
971- plugging in third-party or custom solutions.
964+ well, although this is not provided by core Spring. Spring offers only appropriate hooks
965+ for plugging in third-party or custom solutions.
972966
973967
974968
@@ -1608,6 +1602,19 @@ implementation of Spring's `PlatformTransactionManager` for JMS (the cunningly n
16081602`JmsTransactionManager`). This allows for seamless integration of JMS as a transactional
16091603resource into Spring's transaction management mechanisms.
16101604
1605+ [NOTE]
1606+ ====
1607+ As of Spring Framework 5, Spring's JMS package fully supports JMS 2.0 and requires the
1608+ JMS 2.0 API to be present at runtime. We recommend the use of a JMS 2.0 compatible provider.
1609+
1610+ If you happen to use an older message broker in your system, you may try upgrading to a
1611+ JMS 2.0 compatible driver for your existing broker generation. Alternatively, you may also
1612+ try to run against a JMS 1.1 based driver, simply putting the JMS 2.0 API jar on the
1613+ classpath but only using JMS 1.1 compatible API against your driver. Spring's JMS support
1614+ adheres to JMS 1.1 conventions by default, so with corresponding configuration it does
1615+ support such a scenario. However, please consider this for transition scenarios only.
1616+ ====
1617+
16111618
16121619
16131620[[jms-using]]
0 commit comments