"Enterprise Integration with Spring" certification

Posted by Monik, 13 January 2015.
Programming Java Spring
Preparation for certification

These are my notes I took before taking the Enterprise Integration with Spring Certification exam.

I passed the exam. At the second attempt, after actually taking those notes. The fist attempt was after 1-2 weeks of preparation and it was unnecessarily rushed (I knew it’s too early, if you think it’s too early it’s probably too early), The most difficult thing in preparation for this exam was keeping all those different new things separate in my head and not mixing them up. As soon as I knew where I am in the imaginary table of contents, everything was clear. What helped in organising the knowledge was reading this book.

There is some overlap of this exam with the first Spring Core exam. There is also some stuff that logically would belong to Spring Integration but is actually not part of the exam - the amount of material is simply too big to squeeze everything. That is why it is essential to read the official study guide and study according to it. Or to my notes below (which follow the guide) :P

Table of contents

Remoting

  1. The concepts involved with Spring Remoting on both server- and client-side
  2. The benefits of Spring Remoting over traditional remoting technologies
  3. The remoting protocols supported by Spring

  4. Server side Client side
    RMI
    <bean class="RmiServiceExporter">
     <p:service-name value="myServiceNameInRegistry"/>
     <p:service-interface value="...TheService"/>
     <p:service ref="myService"/>
     <p:registry-port="1099"/>
    </bean>
    <bean id, class="RmiProxyFactoryBean">
     <p:service-interface value="myService"/>
     <p:service-url value="rmi://foo:1099/myServiceName
    InRegistry"/>
    </bean>
    Http
    Invoker
    <bean name="/transfer" class="HttpInvokerServiceExporter">
     <p:service-interface value="...TheService"/>
     <p:service ref="myService"/>
    </bean>

    + DispatcherServlet or HttpRequestHandlerServlet with name ”transfer
    <bean id, class="HttpInvokerProxyFactoryBean">
     <p:service-interface value="myService"/>
     <p:service-url value="rmi://foo:8080/services/transfer"/>
    </bean>
    Hessian / Burlap
    same as above, replace “HttpInvoker” with “Hessian” / “Burlap”
  5. How Spring Remoting-based RMI is less invasive than plain RMI
  6. Spring HTTP Invoker: how client and server interact with each other

Web Services

  1. How do Web Services compare to Remoting and Messaging
  2. The approach to building web services that Spring-WS supports

  3. SOAP / POX (Spring WS)
    web.xml
    <servlet>
     <servlet-name>si-ws-gateway</servlet-name>
     <servlet-class>
       MessageDispatcherServlet
     </servlet-class>
     <init-param>
       <param-name>contextConfigLocation</param-name>    
       <param-value>si-ws-config.xml</param-value>
     </init-param>
     <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
     <servlet-name>si-ws-gateway</servlet-name>
     <url-pattern>/quoteservice</url-pattern>
    </servlet-mapping>

    * also add contextConfigLocation as context-param and ContextLoaderListener for app context
    web infrastr. config
    <bean class="....UriEndpointMapping">
     <p:name="defaultEndpoint" ref="ws-inbound-gateway"/>
    </bean>
    app config
    <context:component-scan base-package=”transfers.ws”/>
    <ws:annotation-driven/>
    Endpoint implementation
    @Endpoint
    public class TransferServiceEndpoint {
     ...
     @PayloadRoot(localPart=”transferRequest”, namespace=”http://mybank.com/schemas/tr
     public @ResponsePayload TransferResponse newTransfer(@RequestPayload TransferRequest request){
       ...
     }
    }
    <int-ws:inbound-gateway id="ws-inbound-gateway"
                           request-channel="ws-requests"
                           extract-payload="false"
                          [marshaller/unmarshaller=”jaxb2”]/>
    
  4. The Object-to-XML frameworks supported by Spring-OXM (or Spring 3.0)
  5. <oxm:jaxb2-marshaller
       id=”marshaller”
       contextPath=”reward.ws.types:someotherpackage”/>
    

    , or just simply

    <ws:annotation-driven/> <!-- registers all infrastructure beans needed for annotation-based endpoints, like JAXB2 (un)marshalling-->
    
  6. The strategies supported to map requests to endpoints (?) (link)
  7. Of these strategies, how does @PayloadRoot work exactly?
  8. The functionality offered by the WebServiceTemplate
  9. <bean class=”...WebServiceTemplate”>
      <property name=”defaultUri” value=”http://mybank.com/transfer”/>
      <property name=”marshaller” ref=”marshallerAndUnmarshaller”/>
      <property name=”unmarshaller” ref=”marshallerAndUnmarshaller”/>
      <property name=”faultMessageResolver” ref=”myCustomFaultMessageResolver”/>
    </bean>
    
    <bean id=”marshallerAndUnmarshaller” class=”...CastorMarshaller”>
      <property name=”mappingLocation” value=”classpath:castor-mapping.xml”/>
    </bean>
    
    template.marshallSendAndReceive(new TransferRequest(“S123”));
    template.sendSourceAndReceiveToResult(source, result);
    
    full definition, e.g.:
    doSendAndReceive(MessageContext messageContext, WebServiceConnection connection, WebServiceMessageCallback requestCallback, WebServiceMessageExtractor<T> responseExtractor)
    
  10. The underlying WS-Security implementations supported by Spring-WS (link)
  11. <ws:interceptors>
     <bean class=”blabla.SoapEnvelopeLoggingInterceptor”
    </ws:interceptors>
    

    or

    <ws:interceptors>
     <ws:payloadRoot localPart=”MyRequest” namespaceUri=”htpp://blabla.com/namespace”>
        <bean class=”blabla.SoapEnvelopeLoggingInterceptor”
     </ws:payloadRoot>
    </ws:interceptors>
    

    client-side:

    <bean class=”org...WebServiceTemplate”>
     <property name=”interceptors”>
       <bean class=”blablabalInterceptor”
     </property>
    </bean>
    
  12. How key stores are supported by Spring-WS for use with WS-Security (?)

RESTful services with Spring-MVC

  1. The main REST principles
  2. REST support in Spring-MVC

JMS with Spring

  1. Where can Spring-JMS applications obtain their JMS resources from
  2. Destination
    <bean id=”orderQueue” class=”org.apache.activemq...ActiveMQQueue”>
     <constructor-arg value=”queue.orders”/>
    </bean>
    <jee:jndi-lookup id=”orderQueue” jndi-name=”jms/OrderQueue”/>
    ConnectionFactory
    <bean id=”cf” class=”org.apache.activemq.ActiveMQConnectionFactory”>
     <property name=”brokerURL” value=”tc[://localhost:61616”/>
    </bean>
    <jee:jndi lookup id=”cf” jndi-name=”jms/ConnectionFactory”/>
    Connection
    connectionFactory.createConnection();
    Session
    created from the Connection
    JMS Message
    created from Session

    session.createProducer(destination);
    MessageProducer
    MessageConsumer
  3. The functionality offered by Spring's JMS message listener container, including the use of a MessageListenerAdapter through the 'method' attribute in the <jms:listener/> element
  4. <jms:listener-container connection-factory=”cf”>
    <jms:listener destination=”queue.orders”
                  ref=”myListener
                  (method=”order”)
                  (response-destination=”queue.confirmation”)/>
    </jms:listener-container>
    
  5. The functionality offered by the JmsTemplate
  6. void convertAndSend([String/Destination d,] Object m)
    void convertAndSend(Object m, MessagePostProcessor mpp) // to do stuff to the message after it has been converted
    void send(MessageCreator mc) // is used inside convertAndSend()
    
    Object execute(ProducerCallback<T> action)
    Object execute(SessionCallback<T> action)
    
    Message receive([String/Destination d,])
    Object receiveAndConvert(destination)
    

Transactions

  1. Local JMS Transactions with Spring
  2. How to enable local JMS transactions with Spring's message listener container
  3. <jms:listener-container acknowledge=”auto|client|dups_ok|transacted”/>
    

    or

    <jms:listener-container transaction-manager=”tm”/>
    
    connection.createSession(transacted=true, acknowledgeMode);
    session.commit();
    session.rollback();
    
  4. If and if so, how is a local JMS transaction made available to the JmsTemplate
  5. How does Spring attempt to synchronize a local JMS transaction and a local database transaction (?)
  6. The functionality offered by the JmsTransactionManager (?)
  7. What guarantees does JTA provide that local transactions do not provide
  8. How to switch from local to global JTA transactions
  9. <jms:listener-container transaction-manager=”transactionManager” ../>
    
  10. Where can you obtain a JTA transaction manager from

Batch processing with Spring Batch

  1. Main concepts (Job, Step, Job Instance, Job Execution, Step Execution, etc.)
  2. The interfaces typically used to implement a chunk-oriented Step
  3. How and where state can be stored
  4. What are job parameters and how are they used
  5. What is a FieldSetMapper and what is it used for

Spring Integration

  1. Main concepts (Messages, Channels, Endpoint types)
  2. Pay special attention to the various Endpoint types and how they're used!
  3. How to programmatically create new Messages
  4. Using chains and bridges
  5. Synchronous vs. asynchronous message passing: the different Channel types and how each of them should be used
  6. The corresponding effects on things like transactions and security
  7. The need for active polling and how to configure that

Comments


Comments: