Setting up GlassFish for JMS
2014-05-28 08:43
393 查看
from: https://www.packtpub.com/article/setting-glassfish-jms-working-with-message-queues
[ Share this article ]
Share this page via Facebook, Twitter or LinkedIn.
inShare
[ Send this article ]
[ Save this article ]
by David R. Heffelfinger | July2010 |
Java Open Source
The JavaMessaging
API (JMS)provides
a mechanism for Java EE applications to send messages toeach other. JMS applications do not communicate directly, insteadmessage producers send messages to a destination and messageconsumers receive the message from the destination.
The message destination is a message queue when the point-to-point(PTP) messaging domain is used, or a message topic when thepublish/subscribe (pub/sub) messaging domain is used.
In this article by DavidHeffelfinger,
author of the book JavaEE
6 with GlassFish 3 Application Server, we will cover thefollowing topics:
Setting up GlassFish for JMS
Working with message queues
(For
more resources on Java, see here.)
Before we start writing code to take advantage of the JMS API, weneed to configure some GlassFish resources. Specifically, we needto set up a JMSconnection
factory, a messagequeue,
and a messagetopic.
The easiest way to set up a JMS connection factory is viaGlassFish's web console. The web console can be accessed bystarting our domain, by entering the following command in thecommand line:
Then point the browser to http://localhost:4848 andlog
in:
A connection factory can be added by expandingthe Resources nodein
the tree at the left-hand side of the web console, expandingthe JMSResources node
and clicking onthe ConnectionFactories node,
then clicking onthe New...button
in the main area of the web console.
For our purposes, we can take most of the defaults. The only thingwe need to do is enter aPoolName and
pick a ResourceType for
our connection factory.
It
is always a good idea to use a PoolName starting
with "jms/" when picking a namefor JMS resources. This way JMS resources can be easily identifiedwhen browsing a JNDI tree.
In the text field labeled PoolName,
enter jms/GlassFishBookConnectionFactory.Our
code examples later in this article will use this JNDI name toobtain a reference to this connection factory
Setting up GlassFish for JMS and Working with MessageQueues
[ Share this article ]Share this page via Facebook, Twitter or LinkedIn.
inShare
[ Send this article ]
[ Save this article ]
by David R. Heffelfinger | July2010 |
Java Open Source
The JavaMessaging
API (JMS)provides
a mechanism for Java EE applications to send messages toeach other. JMS applications do not communicate directly, insteadmessage producers send messages to a destination and messageconsumers receive the message from the destination.
The message destination is a message queue when the point-to-point(PTP) messaging domain is used, or a message topic when thepublish/subscribe (pub/sub) messaging domain is used.
In this article by DavidHeffelfinger,
author of the book JavaEE
6 with GlassFish 3 Application Server, we will cover thefollowing topics:
Setting up GlassFish for JMS
Working with message queues
(For
more resources on Java, see here.)
Setting up GlassFish for JMS
Before we start writing code to take advantage of the JMS API, weneed to configure some GlassFish resources. Specifically, we needto set up a JMSconnectionfactory, a messagequeue,
and a messagetopic.
Setting up a JMS connection factory
The easiest way to set up a JMS connection factory is viaGlassFish's web console. The web console can be accessed bystarting our domain, by entering the following command in thecommand line:asadmin start-domain domain1
Then point the browser to http://localhost:4848 andlog
in:
A connection factory can be added by expandingthe Resources nodein
the tree at the left-hand side of the web console, expandingthe JMSResources node
and clicking onthe ConnectionFactories node,
then clicking onthe New...button
in the main area of the web console.
For our purposes, we can take most of the defaults. The only thingwe need to do is enter aPoolName and
pick a ResourceType for
our connection factory.
It
is always a good idea to use a PoolName starting
with "jms/" when picking a namefor JMS resources. This way JMS resources can be easily identifiedwhen browsing a JNDI tree.
In the text field labeled PoolName,
enter jms/GlassFishBookConnectionFactory.Our
code examples later in this article will use this JNDI name toobtain a reference to this connection factory
相关文章推荐
- Setting up Standalone BLAST for Windows
- Setting up an RTEMS Development Environment for Windows
- <Ejb3InAction> Sample04 for Glassfish - MDB Samples
- Setting up compiler in Windows Eclipse for cpp
- Flex for Free: Setting Up the Flex 4 SDK with Eclipse IDE
- iOS-Best Practices for Setting Up Your Local Device as a Peripheral(API Reference) the seventh part
- Glassfish Cannot run program "/usr/libexec/StartupItemContext; error=2 , No such file or directory
- Setting up Vim for React.js
- Setting Up the Development Environment for SharePoint 2010 on Windows Vista,
- Setting Up a Flash Recovery Area for RMAN
- (Visual Studio)Part 4: Setting up Code for the Debugger
- hector_slam/Tutorials/SettingUpForYourRobot
- Some solutions for simple errors/exceptions when setting up Spring
- Set GlassFish Java EE Application Server Plugin for Eclipse
- Setting up Visual Studio 2012 for SharePoint 2013 development offline
- Setting Up PayPal for your Magento Store
- Setting up PhoneGap on Ubuntu for Android app development
- ubuntu android 设备识别 Setting up a Device for Development
- Setting up your App domain for SharePoint 2013
- Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows