Skip to content

Commit

Permalink
initial code
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmking committed Oct 28, 2013
0 parents commit 880d07b
Show file tree
Hide file tree
Showing 80 changed files with 11,651 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.class

# Package Files #
*.jar

.project
.classpath
data/
.git/
target/
.settings

*.log
*.swp
*.diff
*.patch
91 changes: 91 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
ActiveMQ Store MongoDB project
=========

### Introduce
This project for creating an ActiveMQ Store by MongoDB.

### Architecture
1. modify activemq.xsd in activemq-core.jar, insert mongodb node after kahaDB node:
<xs:element name='mongodb'>
<xs:annotation>
<xs:documentation><![CDATA[
An implementation of {@link PersistenceAdapter} designed for use with mongodb.
]]></xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name='brokerService' minOccurs='0' maxOccurs='1'>
<xs:complexType>
<xs:choice minOccurs='0' maxOccurs='1'>
<xs:element ref='tns:broker' />
<xs:element ref='tns:brokerService' />
<xs:any namespace='##other' />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name='usageManager' minOccurs='0' maxOccurs='1'>
<xs:complexType>
<xs:choice minOccurs='0' maxOccurs='1'>
<xs:element ref='tns:systemUsage' />
<xs:any namespace='##other' />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded' />
</xs:sequence>
<xs:attribute name='archiveDataLogs' type='xs:boolean' />
<xs:attribute name='brokerName' type='xs:string' />
<xs:attribute name='brokerService' type='xs:string' />
<xs:attribute name='checkForCorruptJournalFiles' type='xs:boolean' />
<xs:attribute name='checkpointInterval' type='xs:long'>
<xs:annotation>
<xs:documentation><![CDATA[
Get the checkpointInterval
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='checksumJournalFiles' type='xs:boolean' />
<xs:attribute name='cleanupInterval' type='xs:long'>
<xs:annotation>
<xs:documentation><![CDATA[
Get the cleanupInterval
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='concurrentStoreAndDispatchQueues'
type='xs:boolean' />
<xs:attribute name='concurrentStoreAndDispatchTopics'
type='xs:boolean' />
<xs:attribute name='databaseLockedWaitDelay' type='xs:integer' />
<xs:attribute name='host' type='xs:string'>
<xs:annotation>
<xs:documentation><![CDATA[
Get the host
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='port' type='xs:integer'>
<xs:annotation>
<xs:documentation><![CDATA[
Get the port
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='db' type='xs:string'>
<xs:annotation>
<xs:documentation><![CDATA[
Get the db
]]></xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

2. add mongodb in META-INF/services/org/apache/xbean/spring/http/activemq.apache.org/schema/core in activemq-core.jar:
mongodb = org.qsoft.activemq.store.mongodb.MongodbPersistenceAdapter

3. configure your mongodb server in your activemq.xml:
<persistenceAdapter>
<mongodb host="127.0.0.1" port="27017" db="activemq" />
</persistenceAdapter>
4. package this project to a jar to reference in your project
180 changes: 180 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-parent</artifactId>
<version>5.7.0</version>
</parent>

<artifactId>activemq-store-mongodb</artifactId>
<packaging>bundle</packaging>
<name>ActiveMQ :: Store :: Mongodb</name>
<description>A persistence adapter with mongodb.</description>

<dependencies>

<!-- =============================== -->
<!-- Required Dependencies -->
<!-- =============================== -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>activemq-core</artifactId>
<optional>false</optional>
</dependency>

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-annotation_1.0_spec</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.15</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<optional>true</optional>
</dependency>

<!-- for XML parsing -->
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
<optional>true</optional>
</dependency>
<!-- dependency>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
<optional>true</optional>
</dependency> -->

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
</dependency>

<!-- =============================== -->
<!-- Testing Dependencies -->
<!-- =============================== -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>activeio-core</artifactId>
<optional>false</optional>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<!-- dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-jmdns_1.0</artifactId>
<optional>true</optional>
</dependency> -->

<!-- database testing -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-primitives</groupId>
<artifactId>commons-primitives</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>axion</groupId>
<artifactId>axion</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
<scope>test</scope>
</dependency>

</dependencies>


</project>
Loading

0 comments on commit 880d07b

Please sign in to comment.