TechnoBuzz

A Techno Blog, mainly about Java

JMS Intro

JMS ~ high load where you can add queue’s in front of it to handle weight

Asysnchronous , Message Oriented Middleware

JMS Message Type

Text Message,ObjectMessage,MapMessage..

Queue point to point messaging

Topic – publish /subscribe messaging

A Session is created from the Connection. Unit of work, transactional capability.  Responsible for creation of various JMS message types.

Producer (put message on), Consumer (pull message off)

Apache MQ

Destination – point to point or topic are examples

Spring has a JmsTemplate : delegates to collaborators to handle some of work

Message Converter – conver from objects to messages (SimpleMessageConverter)

DestinationResolver – resolve destination names (DynamicDestinationResolver or JNDIDestinationResolver)

Sending messages – one line methods or callback methods

producer call back or session callbacks

MessageDrivenBeans wait for the message. MessageConverters can be used on recption side.

JMS MessageListener aysnchronous reception

Spring has light light weight mechanism for listen for messages, as compared to EJB

SimpleMessageListenerContainer or DefaultMessageListenerContainer

Spring supports 2 phase commit

Advertisements

July 1, 2010 Posted by | Spring | Leave a comment

Springathon

Testing in Spring 3.0 much better. Use @Setup or @Test , @RunWith  @ContextConfiguration annotations.

Mocks or Stubs ?

What is AOP

  • Capture functionality used throughout app in a single, reusable way, e.g. transaction, logging, security.
  • Transaction management, logging, security are cross cutting concerns cutting across multiple objects.
  • AOP is the implementation of these cross cutting concern.

Join point: a point in the execution of a program such as a method call or a field assignment. e.g., method1 in Class A and method2 in Class B are the join points that require transaction related advice.

Pointcut: An expression that selects one or  more join points. Advice can be associated with a pointcut expression and runs at any join point method.

Advice: Code that is executed at a particular join point that has been selected by a Poincut. Different types of advices are “around,” “before” and “after” advice.

Aspect:  A module that encapsulates pointcuts and advice. e.g., transaction, security, logging in this case.

Spring AOP uses aspectJ expression language: http://www.eclipse.org/aspectj

designator (* package.Class.method*(..))

@Before @AfterReturning @AfterThrowing @After @Around

Transactions

ACID: Atomic, Consistent, Isolated, Durable

ACEGI – former name for spring security ~ every other letter (missing B,D,F,H)

July 1, 2010 Posted by | Spring | Leave a comment