javapandit.net
  • Home
  • Quick Java
    • Exception Handling
    • Collections Framework
  • Java Best Practices
  • Web Services
    • Web Service Basics
    • Ten Basic webservice concepts
    • XML
    • Apache Axis
    • Restful Web Services
  • JMS Concepts
    • JMS- MySQL
  • Hadoop
    • NoSQL DATABASEs
    • Apache Sqoop
    • Hadoop Interview Questions
  • Java 5
  • Java 8
    • Java 8 : Lambda Expressions
  • JDBC
  • Java Architect
    • Enterprise application re-platforming strategies
    • Java Memory Management
  • Java Programs
  • Technical Tips
    • How to set JAVA_HOME environment variable
    • How to create an auto increment field in Oracle?
    • Linux Commands
  • Best Java Interview Questions
    • Java Interview Questions- YouTube
  • Interview Questions
    • Java Tech interview Questions
    • Core Java Interview Questions >
      • core tech questions1
      • Java Collection interview questions
      • Java Concurrency
    • Servlets Interview Questions
    • JSP Interview Questions
    • Java Web Services Interview Questions
    • EJB Interview Questions
    • XML Interview Questions
    • JMS Interview Questions
  • Struts Interview Questions
    • Struts 2 Interview Questions
  • Java EE Architects Interview Questions
    • Java Architect Interview Questions
    • Top 10 reasons for Java Enterprise Application Performance Problems
    • Web Application Scalability Questions for IT Architect
  • JavaPandit's Blog
  • Web Services Interview Questions
  • Servlets And JSP
  • Oracle SOA Interview Questions
    • Open ESB /JBI
    • BPEL Language
  • Log4J
  • Ant
  • Maven
  • JMeter
  • JUnit
  • Apache POI Framework
  • ORCALE SERVICE BUS (OSB) Interview Questions
  • J2EE Patterns
    • Model-View-Controller (MVC)
    • Front Controller
    • DAO
    • Business Delegate
    • Session Facade
    • Service Locator
    • Transfer Object
    • Design Patterns >
      • Creational Patterns >
        • Singleton
      • Behavioural Patterns
      • Structural Patterns
    • Intercepting Filter
  • SQL Interview Questions/Lab
  • Best Wall Papers
    • Devotional Songs
  • Java Community
  • HIBERNATE
  • ORACLE CC&B
    • Oracle CC&B Interview Questions
  • Docker
  • Little Princess
    • Sai Tanvi Naming Ceremony Celebrations
    • Rice Feeding Ceremony
    • Sai Tanvi Gallery
  • APPSC Career Guidance
    • AP History
    • Indian Polity
    • Indian Economy
    • Science & Technology
    • Mental Ability and Reasoning
    • Disaster Management
    • Current Affairs and Events
    • General Sciences >
      • Biology
      • Physics
      • Chemistry
    • Previous Question Papers
  • About Us
  • Contact US
Message Consumption:
Messages can be consumed in either of two ways:

• Synchronously:
A subscriber or a receiver explicitly fetches the message from the destination by calling the receive method.
The receive method can block until a message arrives or can time out if a message does not arrive
within a specified time limit.

• Asynchronously:
A client can register a message listener with a consumer. A message listener is similar to an event listener. Whenever a message arrives at the destination, the JMS provider delivers the message by calling the listener’s
onMessage() method.

JMS API Programming Model
The basic building blocks of a JMS application consist of

    • Administered objects: connection factories and destinations
    • Connections
    • Sessions
    • Message producers
    • Message consumers
    • Messages
Picture
Administered Objects:
Two parts of a JMS application—destinations and connection factories—are best maintained administratively rather than programmatically.

JMS clients access these objects through interfaces that are portable, so a client application can run with little or no change on more than one implementation of the JMS API. Ordinarily, an administrator configures administered objects in a Java Naming and Directory Interface (JNDI) API namespace, and JMS clients
ADMINISTERED OBJECTS 23 then look them up, using the JNDI API. J2EE applications always use the JNDI
API.

Connection Factories:
A connection factory is the object a client uses to create a connection with a provider. A connection factory encapsulates a set of connection configuration parameters that has been defined by an administrator.

Each connection factory is an instance of either the QueueConnectionFactory or the TopicConnectionFactory interface.

You can also create new connection factories by using the following commands:
    j2eeadmin -addJmsFactory jndi_name queue
    j2eeadmin -addJmsFactory jndi_name topic

For example, the following code fragment obtains an InitialContext object and uses it to look up the QueueConnection-Factory and the TopicConnectionFactory by name:

        Context ctx = new InitialContext();
        QueueConnectionFactory queueConnectionFactory =
                                                                (QueueConnectionFactory) ctx.lookup("QueueConnectionFactory");

        TopicConnectionFactory topicConnectionFactory =
                                                                (TopicConnectionFactory) ctx.lookup("TopicConnectionFactory");
Prev 1 2 3 4 5 6 7 89 Next
Powered by Create your own unique website with customizable templates.