aspose file tools*
The moose likes JBoss/WildFly and the fly likes how to use MSSQL for JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "how to use MSSQL for JMS" Watch "how to use MSSQL for JMS" New topic
Author

how to use MSSQL for JMS

uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

hi,
could anyone please tell me the procedure to use mssql for messaging in JBoss 5. i am using mssql as my datasource. should i replace hsqldb-persistence-service.xml with mssql-persistence-service.xml?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Which version of JBoss AS, and if you are using 4.2.x, did you install JBoss Messaging and if so which version?

For JBoss AS 5.0.1.GA, the steps were recently discussed at http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4224936#4224936. While that discussion centered on MySQL, the steps for SQL Server should be similar.


JBoss In Action
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Hi Peter,
thanks for your suggestion, it works fine.
One more thing I want to know is that previously there was a file jbossmq-state.xml in %JBOSS_HOME%/server/xxx/conf folder in which we define users and their roles etc. in JBOSS AS 5, which is the corresponding file in which we can do the same?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Looks like this file was used to provide a means to initialize the database with some users and roles. You can do the same in the mysql-persistence-service.xml file, look at the POPULATE.TABLES.NN entries at the end of the file. Personally, other than for testing, I think that this is the wrong way to populate the database with users and roles.
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

yes Peter, you are right, I am too thinking that this is not the right way to populate database with users and roles. I search on google but find no way to create users and roles. The only way i can see is through xxx-persistance-service.xml.
if we create users and roles in this way how we can connect a user with a durable topic subscription because i dont know which table is used for which purpose?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

One possibility: populate the tables using SQL statements fed to the mysql utility.

In JBoss in Action, I define a completely separate database to hold the messaging users and use SQL statements to populate that database. Then I set up a database login module that uses that database for authentication, and reference that login module from JMS. Thus that example completely ignores that users and roles tables created by the messaging service. Actually, if I wanted to I could have simply remobed those tables and the SQL statements that use them from the *-persistence-service.xml file, but I didn't.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use MSSQL for JMS
 
Similar Threads
Datasource Configuration in JBoss
how to create DurableTopicSubscriptions in JBoss 5
Connecting to MySql in JBOSS5.1.0.GA
setting up MS SQL Server as a data source with JBoss
problem in configuring jboss-3.2.3 with mssqlserver2000