[jboss-user] [JBoss Messaging] - Re: Authentication issues. (User null is NOT authenticated)

lhunath do-not-reply at jboss.com
Fri Apr 11 03:47:05 EDT 2008


This is the code used for sending an audit message on the audit queue.

  | 	public static final String CONNECTION_FACTORY_NAME = "java:/JmsXA";
  |             [...]
  | 
  | 	@Resource(mappedName = AuditConstants.CONNECTION_FACTORY_NAME)
  | 	private ConnectionFactory factory;
  | 
  | 	@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  | 	public void finalizeAuditContext(Long auditContextId) {
  | 		LOG.debug("finalizing audit context: " + auditContextId);
  | 		AuditMessage auditMessage = new AuditMessage(auditContextId);
  | 		try {
  | 			Connection connection = this.factory.createConnection();
  | 			try {
  | 				Session session = connection.createSession(true, 0);
  | 				try {
  | 					MessageProducer producer = session
  | 							.createProducer(this.auditBackendQueue);
  | 					try {
  | 						Message message = auditMessage.getJMSMessage(session);
  | 						producer.send(message);
  | 					} finally {
  | 						producer.close();
  | 					}
  | 				} finally {
  | 					session.close();
  | 				}
  | 			} finally {
  | 				connection.close();
  | 			}
  | 		} catch (JMSException e) {
  | 			this.auditAuditDAO.addAuditAudit("unable to publish audit context "
  | 					+ auditContextId + " - reason: " + e.getMessage()
  | 					+ " - errorCode: " + e.getErrorCode());
  | 		}
  | 	}

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143370#4143370

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143370



More information about the jboss-user mailing list