The first thing to note is that JBoss 4.0.5 will be running JBossMQ by default (As opposed to the newer JBoss Messaging). The answers to some of your questions depend on what you're doing, i.e. MDBs/EJB3 or not?
Note, you'll have to add http:// to the beginning of these links, Stackoverflow is being lame and not letting me post links.
Take a look at this URL: www.java2s.com/Code/Java/EJB3/EJBTutorialfromJBossdemoformessagedrivenbean.htm
- The Queue will be created for you automatically when JBoss loads the MDB in the example
Assuming you mean a JMS Connection Factory, you can inject factories and destinations into EJB3s using something like the following:
@Resource(mappedName = "queue/notification.EmailSender")
private javax.jms.Destination emailSenderQueue;
@Resource(mappedName = "QueueConnectionFactory")
private javax.jms.ConnectionFactory connectionFactory;
This is a good starting point: www.jboss.org/file-access/default/members/jbossas/freezone/docs/Server_Configuration_Guide/4/html/Messaging_on_JBoss.html
Also if you're not doing EJB3 yet in Jboss 4.0.3, see: rwatsh.blogspot.com/2006/12/ejb3-development-using-jboss-405ga.html