Message driven architecture with spring – the server side java symposium

Mark Fisher has a cool twitter handle @m_f_
Pardon the lack of formatting, there was just too much information to learn plus watch live demos and type lists on an ipad. I will clean it up over the weekend. [cleaned up] Too much content is a good “problem” for a presentation to have.

libraries:

  1. Spring Integration
  2. Spring AMQP in release candidate mode.  Similar to Spring JMS but doesn’t hide it behind JMS. AMQP is an open wireless protocol.  Also use you set up a routing exchange and set up a routing key for clients to bind to.  For example news.star.us so can subscribe to different levels on broker. works with non Java clients

Events

  • Has been in Spring since the very beginning
  • interface ApplicationEventPublisherAware allows you to make a callback
  • Interface ApplicationListener is called when event occurs, can use generics to say what type of events you care about
  • Can do without forcing to extend spring interface as well

Messaging

  • JmsTemplate – prefer CachingConnectionFactory to ensure sessions are reused
  • Jms:listener-container defined in xml on a pojo
  • Or use AmqpTemplate instead of JmsTemplate to use amqp, works the same as jmstemplate, for example you can call receive/send methods
  • Amqp namespace released this week to support listeners
  • Showed demo with rabbitmq including using web ui to see how many messages on queue
  • RestTemplate for http messaging, can use HttpMessageConverters if need to be more specific

Mail

  • SimpleMailMessage to create a message and inject MailSender to send it, good for simple messages, there is a mime one for more complex messsages
  • Core Spring cannot receive e-mail. Spring Integration can

Polling

  • Better to use events/messaging and only poll when you have to
  • Lifecycle interface – start(), stop() and isRunning()
  • SmartLifecycle does those three plus autostartup, phases and adds a callback on stop

Scheduling

  • taskScheduler interface lets you schedule one time tasks, tasks at a fixed rate and tasks at a fixed delay
  • Trigger interface lets you control the next execution time along with the Trigger Context that gives information about the last scheduled/actual time
  • This means you don’t need quartz for simple operations
  • The @Scheduled annotation lets you specify cron or fixed time/delay expressions instead of interfaces
  • Can also create your own annotations to externalize the cron expression so using your custom annotation without duplicating the configuration of the cron expression

Pipes and filters

  • Message can be any object as the payload with headers in a map, the message is immutable unless your payload itself is mutable
  • MessageChannel can do point to point or publish subscribe, set channel, types in xml using  and can also set whether async
  • A gateway can be one way or bidirectional
  • Can use @publisher to put the result of a method or argument to go on a channel as a side effect of calling the method
  • Filters return booleans
  • Router directs to proper channel name
  • Can route on payload type, header type etc
  • Can split/aggregate channels
  • Spring Integration 2.0 lets you use el to specify bindings, etc
  • Can chain when don’t need explicit channel names

spring 3 certification – about the test

Table of contents for the Spring 3 certification series of posts:

  1. Jeanne’s core spring 3 certification experiences (Background information)
  2. About the test (includes Scope of the test and Spring 2.5 vs 3.0 exam)
  3. What did I read and how were the resources I tried
  4. My study plan
  5. Skills guru mock exam
  6. What I would recommend as a study plan

About the test

It really shouldn’t be necessary to put this in a blog post.  But the information is so scattered that it is.  Here’s what is known:

  • 50 questions
  • 90 minutes (it was 88 minutes when I took it, but it is possible they counted the two minutes I spent reading the rules about what can and can’t be shared.)
  • passing score is 76%
  • there is an official study guide
  • there are no official mock exams

That’s it.  That is literally all the information I found about the Core Spring 3 certification.  There is also some information about the 2.5 exam linked from the JavaRanch Spring Certification FAQ page.

Scope of the test

As Dan said in his 2.5 writeup:

Although I am not allowed to comment on the specific questions I can comment on the topics. One of the frustrations that I and many others have, is that there is just no real decent way to simulate this exam from a trusted source like you would with a Sun certification. So you are quite in the dark when it comes to an effective preparation on what is a massive topic. So hopefully the following information might be useful to you.

Following that philosophy, here’s the distribution for Spring 3:

  • Container and test (20)
  • AOP (10)
  • JDBC (3)
  • Transactions (4)
  • Web (2)
  • REST (2)
  • Remoting  (2)
  • Security (2)
  • JMS (2)
  • JMX (2)

The total does come to 50 because the questions were ordered in the same way as on the study guide making it easy to remember.  It could vary of course – this is just what I got.

Types of questions

Each questions has four answer choices.  There were a few types of questions. I note this because one of the few things I thought I knew prior to the exam was that each question has only one correct answer.  This turned out to be incorrect.

  • Select one answer
  • Select X answers
  • Select one or more answers (I don’t like this type where they don’t tell you how many are correct.)
  • Select the one that is not correct (this is ok – this is like “select three”

Most of the questions were fairly high level with a few detailed ones.  It didn’t stray far from the course or study guide which was a pleasant surprise given what I heard about the 2.5 exam.

There was also a question that contained a spelling error.  I was disappointed to see this in a published test; it says something about the quality control process.  I imagine since the Spring 3 test is fairly new, this will get shaken out soon.

Overall impressions

Finally, I’d like to compare my impression of the exam before and after.  I wrote the following before taking the exam.

The funny thing is Gavin [2.5 notes creator] says he doesn’t know what is on the exam because he is a grandfathered candidate and didn’t take the class. Ironically, I did take the class and don’t know what’s on the exam.  The class manual is too easy and doesn’t cover edge cases so clearly isn’t sufficient.  And the skills guru mock exam covered things that weren’t in the Spring 3 objectives and not mentioned in the class.   I’m not sure if he overthought things, the Spring 2.5 exam was harder or I’m still not grasping what is on the exam.  I do note the actual stated 2.5 had more in them such as Hessian/Burlap.

Now that I’ve taken the exam, I can say that the few available materials on the web created a lot more worry about the exam than was necessary.  The course student guide *is* on the level of the exam.  And the mock exams are much harder and contain content that is out of scope.

Spring 2.5 vs 3.0 exam

The Spring 2.5 exam sounds like it was a lot harder than the Spring 3.0 exam.  This is unfortunate in some ways – it means the certification means less.  Of course, if you are a candidate for the 3.0 exam. it is a good thing.  I wonder if the “dumbing down” of the exam has anything to do with ending the grandfathering of candidates.  The 3.0 exam is more like a course review whereas the 2.5 one sounded more like a knowledge of Spring test.  And since one is required to take the class before taking the test, this is most of the studying required.

Previous page: Background Information

Next page: Readings and Resources

spring 3 certification – readings and resources

Table of contents for the Spring 3 certification series of posts:

  1. Jeanne’s core spring 3 certification experiences (Background information)
  2. About the test (includes Scope of the test and Spring 2.5 vs 3.0 exam)
  3. What did I read and how were the resources I tried
  4. My study plan
  5. Skills guru mock exam
  6. What I would recommend as a study plan

I tried some other exams that didn’t claim to be mocks. See the week by week section for those. Or for more details about the resources in this table.

Resource Spring Version Cost Comments
The official student guide and lab manual from course 3.0 came with course I think studying this would have been enough to pass (with a low passing score.)
Spring in Action (3rd edition) 3.0 $30/$50 The parts of the book that are already written were enjoyable to read. I learned a lot from them although not necessarily things that were on the test. Some test material was reinforced well though.
Sections from Official Reference Documentation 3.0 $0 Again interesting and I learned a lot, but definitely overkill for the test.
Spring Source’s Sample questions 2.5 $0 I thought these questions were too easy when I first read them. Now I think the level is equivalent to the exam. Even though they are 2.5, the content still applies. They are not multiple choice though.
Gavin Lasnitzki’s study notes 2.5 $0 These are a lot more detailed than the exam. They are faster to read than the official documentation so good for a review.
Skill-guru mock exam #1 3.0 $0.99 It’s the best we have, but keep in mind it is a lot harder than the real exam and contains material that is out of scope. See Skills Guru section for more detail.
Skill-guru mock exam #2 3.0 $0.99 See comments for exam #1. I felt more questions were out of scope in this exam.
BlackBeltFactory’s mock exam 3.0 contribution point based I led the creation of this exam as I was studying. It is significantly harder than the real exam. At the time of this blog post, it is in public beta state. Now released.
Jeanne Boyarsky’s study notes 3.0 $0 I wrote them so I’m biased.

I’ve also read some other Spring books in the past for older versions of Spring.

Disclosure: I received a free copy of “Spring in Action” exchange for writing a review of the book when it prints. I am also a volunteer administrator at BlackBeltFactory from when I was active in the early days. This means I have thousands of contribution points and didn’t have to think about the cost when taking exams.

Previous page: About the test

Next page: My study plan