Book Image

NetBeans IDE 8 Cookbook

By : David Salter, Rhawi Dantas
Book Image

NetBeans IDE 8 Cookbook

By: David Salter, Rhawi Dantas

Overview of this book

<p>From the start to the end of a Java project's lifecycle, this book will show you how to perform many key tasks with the NetBeans IDE, uncovering more about mobile, desktop, and enterprise Java along the way.</p> <p>You will start by creating Java projects and learning how to refactor and use NetBeans tools to increase developer efficiency. You will then get a walkthrough of how to create a desktop application before covering JavaFX and mobile applications and how to use external services within them. Having seen how to create many different types of applications, you will then be shown how to test and profile them before storing them in revision control systems such as Git or Subversion. Finally, you will learn how to extend NetBeans itself by adding new features to the IDE.</p>
Table of Contents (19 chapters)
NetBeans IDE 8 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a Message Driven EJB


A Message Driven EJB is a special type of EJB that is responsible for listening to messages sent to JMS queues and acting upon them. Message Driven EJBs provide an easy way of interfacing with JMS queues and make full use of Java annotations to define queue settings.

In this recipe, we'll see how we can send a message to a JMS queue hosted on WildFly, and then how a Message Driven Bean will respond to the message.

Getting ready

In order to complete this recipe, we need to have an instance of WildFly installed locally and configured within NetBeans. We will be using the Enterprise download bundle of NetBeans as this provides all of the necessary plugins required to work with EJBs.

To send messages to a JMS queue, we first need to create the queue within WildFly.

Since the WildFly plugin for NetBeans can't currently create message queues, we'll need to create a message queue using the WildFly command-line interface.

Start WildFly from NetBeans within the Services explorer...