...
- Create Maven Project
Start Eclipse
Go to File -> New -> Project -> Maven Project
Check the Use default Workspace location box and click Next
Select Internal as the catalog
From the list of archetypes, select the maven-archetype-webapp Arctifact Id and click Next
For Group Id, enter edu.ucdavis.iet
For Artifact Id, enter M2Rice
Click Finish
- Embed the Kuali Service Bus
- Identify Rice dependencies
Add the following to your pom.xml Code Block |
---|
|
<repository>
<id>kuali</id>
<name>Kuali Repository</name>
<url>https://test.kuali.org/maven/</url>
</repository>
<dependency>
<groupId>org.kuali.rice</groupId>
<artifactId>rice-ksb</artifactId>
<version>0.9.3</version>
</dependency>
|
- Configure KSB Dispatcher Servlet
Add the following code to web.xml Code Block |
---|
|
<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>edu.iu.uis.eden.messaging.servlet.KSBDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>
|
- Create Rice runtime configuration filesfile
In the project structure, right-click on src/main/webapp/WEB-INF, then New -> File
Name the file M2Rice-config.xml Add the following skeleton : |
---|
Code Block |
---|
title | src/main/webapp/WEB-INF/M2Rice-config.xml |
---|
|
<config>
</config>
|
- Configure Spring Beans
Code Block |
---|
title | src/main/resources/M2Rice-RiceSpringBeans.xml |
---|
|
In the project structure, right-click on *src/main/resources*, then *New -> File |
*
Name the file *M2Rice-RiceSpringBeans.xml |
*
Add the following skeleton code: |
{code |
:title | =src/main/resources/M2Rice-RiceSpringBeans.xml | }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
</beans>
|
Configure Spring Beans
Add the following code: Code Block |
---|
title | src/main/resources/M2Rice-RiceSpringBeans.xml |
---|
|
<bean id="config" class="org.kuali.rice.config.spring.ConfigFactoryBean">
<property name="configLocations">
<list>
<value>classpath:WEB-INF/M2Rice-config.xml</value>
</list>
</property>
</bean>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties" ref="configProperties" />
</bean>
<bean id="configProperties" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="config" />
<property name="targetMethod" value="getProperties" />
</bean>
<bean id="rice" class="org.kuali.rice.config.RiceConfigurer">
<property name="dataSource" ref="workflowDataSourcericeDataSource" />
<property name="transactionManager" ref="myJtaTransactionManagerjotm" />
<property name="userTransaction" ref="myJtaUserTransactionjotm" />
<property name="properties">
<props>
<prop key="message.entity">M2Rice</prop>
<prop key="message.persistence">true</prop>
<prop key="message.delivery">asynchronous</prop>
<prop key="Routing.ImmediateExceptionRouting">false</prop>
<prop key="RouteQueue.timeIncrement">1000</prop>
<prop key="RouteQueue.maxRetryAttempts">3</prop>
<prop key="useQuartzDatabase">true</prop>
<prop key="ksb.org.quartz.scheduler.instanceId">AUTO</prop>
<prop key="ksb.org.quartz.scheduler.instanceName">KSBScheduler</prop>
<prop key="ksb.org.quartz.jobStore.isClustered">true</prop>
<prop key="ksb.org.quartz.jobStore.tablePrefix">KR_QRTZ_</prop>
</props>
</property>
<property name="modules">
<list>
<bean class="edu.iu.uis.eden.messaging.config.KSBConfigurer">
<property name="serviceServletUrl" value="http://localhost:8080/M2Rice/remoting" />
</bean>
</list>
</property>
</bean>
<bean id="riceDataSource" class="org.kuali.rice.database.XAPoolDataSource">
<property name="transactionManager" ref="jotm" />
<property name="driverClassName" value="${datasource.driver.name}" />
<property name="url" value="${datasource.url}" />
<property name="maxSize" value="${datasource.pool.maxSize}" />
<property name="minSize" value="${datasource.pool.minSize}" />
<property name="maxWait" value="${datasource.pool.maxWait}" />
<property name="validationQuery" value="${datasource.pool.validationQuery}" />
<property name="username" value="${datasource.username}" />
<property name="password" value="${datasource.password}" />
</bean>
<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean" />
</beans>
|
Reference
KSB Module Rice XML Configuration Subsystem: https://test.kuali.org/confluence/display/KULRICE/KSBRice+ModuleXML+Configuration+Subsystem
Advanced Configuration: https://test.kuali.org/confluence/display/KULRICE/Advanced+Installation+and+Configuration
KSB Module Configuration: https://test.kuali.org/confluence/display/KULRICE/KSB+Module+Configuration