activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From burner <bjoernpaulsen1...@googlemail.com>
Subject Re: ActiveMQ KahaDB Directory
Date Tue, 02 Feb 2016 11:08:24 GMT
Hello Jan,

1. I start the Eclipse Project. The test Routes inserts Messages in "test2".
2. There are 20, then I went to Message List from Queue "test2"
3. The message shows in Eclipse Console, and the second KahaDB will be
created.
4. I try to Delete the Wrong KahaDB, but it fails because "It is in use"
5. I stop the program in Eclipse
6. I delete the wrong KahaDB
7. Start Programm, and yes the 20 Messages are still there

Here is my pom.xml:

<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>de.testproject</groupId>
	<artifactId>AllInOneBoiler</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>AllInOneBoiler</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<log4j.version>2.2</log4j.version>
		<spring.version>4.2.4.RELEASE</spring.version>
		<camel.version>2.16.1</camel.version>
		<activemq.version>5.13.0</activemq.version>
		<jolokia.version>1.3.2</jolokia.version>
		<jetty.version>9.2.13.v20150730</jetty.version>
	</properties>

	<dependencies>
		
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-jcl</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-web</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		
		
		
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-core</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-spring</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-jms</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-http4</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-mail</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-gson</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-saxon</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-jdbc</artifactId>
			<version>${camel.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-sql</artifactId>
			<version>${camel.version}</version>
		</dependency>
		
		
		
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-client</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-openwire-legacy</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-camel</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-jaas</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-broker</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-console</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-shiro</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-spring</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-pool</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-jms-pool</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-amqp</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-http</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-mqtt</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-stomp</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-kahadb-store</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-leveldb-store</artifactId>
			<version>${activemq.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-jdbc-store</artifactId>
			<version>${activemq.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.activemq.protobuf</groupId>
			<artifactId>activemq-protobuf</artifactId>
			<version>1.1</version>
		</dependency>
		<dependency>
			<groupId>org.fusesource.hawtbuf</groupId>
			<artifactId>hawtbuf</artifactId>
			<version>1.11</version>
		</dependency>
		<dependency>
			<groupId>org.jasypt</groupId>
			<artifactId>jasypt</artifactId>
			<version>1.9.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-jms_1.1_spec</artifactId>
			<version>1.1.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-jta_1.0.1B_spec</artifactId>
			<version>1.1.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
			<version>1.0.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-annotation_1.0_spec</artifactId>
			<version>1.1.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.xbean</groupId>
			<artifactId>xbean-spring</artifactId>
			<version>4.5</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-core</artifactId>
			<version>2.2.11</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.2.11</version>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-web</artifactId>
			<version>${activemq.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.apache.activemq</groupId>
					<artifactId>activemq-all</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		
		
		
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>${spring.version}</version>
		</dependency>
		
		
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-expression</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jms</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${spring.version}</version>
		</dependency>

		
		
		
		<dependency>
			<groupId>org.jolokia</groupId>
			<artifactId>jolokia-core</artifactId>
			<version>${jolokia.version}</version>
		</dependency>
		<dependency>
			<groupId>org.jolokia</groupId>
			<artifactId>jolokia-jvm</artifactId>
			<version>${jolokia.version}</version>
		</dependency>
		<dependency>
			<groupId>org.jolokia</groupId>
			<artifactId>jolokia-spring</artifactId>
			<version>${jolokia.version}</version>
		</dependency>
		
		
		
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-security</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-webapp</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-http</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-annotations</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>apache-jsp</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>apache-jstl</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty.websocket</groupId>
			<artifactId>javax-websocket-server-impl</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		
		
	</dependencies>

	<build>
		<finalName>BoilerPlate Standalone ActiveMQ and Camel</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			
			<plugin>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-maven-plugin</artifactId>
				<version>${camel.version}</version>
			</plugin>
			
			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>${jetty.version}</version>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<transformers>
								<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
									<resource>META-INF/spring.handlers</resource>
								</transformer>
								<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
									<resource>META-INF/spring.schemas</resource>
								</transformer>
							</transformers>
						</configuration>
					</execution>
				</executions>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>org.apache.camel.spring.Main</mainClass>
							<classpathPrefix>lib/</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			
			<plugin> 
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>move-main-class</id>
						<phase>compile</phase>
						<configuration>
							<tasks>
								<copy file="startEmbedded.bat"
tofile="${project.build.directory}/startEmbedded.bat"/>
								<copy todir="${project.build.directory}/conf">
									<fileset dir="conf/"/>
								</copy>
								<copy todir="${project.build.directory}/webapps">
									<fileset dir="webapps/"/>
								</copy>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

Spring context.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:util="http://www.springframework.org/schema/util" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:amq="http://activemq.apache.org/schema/core"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xmlns:camel="http://camel.apache.org/schema/spring"
	xmlns:jolokia="http://www.jolokia.org/jolokia-spring/schema/config"
	xsi:schemaLocation="
		http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd
		http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
		http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
		http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
		http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd
		http://www.jolokia.org/jolokia-spring/schema/config
classpath:External/jolokia-config.xsd
		">

	
	<bean id="systemPrereqs"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
		<property name="targetObject" value="#{@systemProperties}" />
		<property name="targetMethod" value="putAll" />
		<property name="arguments">
				
				<util:properties>
					<prop
key="java.security.auth.login.config">conf/activemq/jaas.config</prop>
				</util:properties>
		</property>
	</bean>
	
	
	<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>file:conf/activemq/jettyLogin.properties</value>
		</property>
	</bean>
	
	<broker id="broker" brokerName="localhost" useShutdownHook="false"
useJmx="true" dataDirectory="activemq-data"
			persistent="true" xmlns="http://activemq.apache.org/schema/core">
			
		<destinationPolicy>
			<policyMap>
				<policyEntries>
					<policyEntry topic=">" >
						<pendingMessageLimitStrategy>
							<constantPendingMessageLimitStrategy limit="1000"/>
						</pendingMessageLimitStrategy>
					</policyEntry>
					<policyEntry queue=">" >
						<deadLetterStrategy>
							<individualDeadLetterStrategy queuePrefix="DLQ." />
						</deadLetterStrategy>
					</policyEntry>
				</policyEntries>
			</policyMap>
		</destinationPolicy>
		
		<managementContext>
			<managementContext createConnector="false"/>
		</managementContext>
		
		<persistenceAdapter>
			<kahaDB directory="activemq-data/localhost/KahaDB"
journalMaxFileLength="100mb" cleanupInterval="5000"/>
		</persistenceAdapter>
		
		<systemUsage>
			<systemUsage>
				<memoryUsage>
					<memoryUsage percentOfJvmHeap="70" />
				</memoryUsage>
				<storeUsage>
					<storeUsage limit="2 gb"/>
				</storeUsage>
				<tempUsage>
					<tempUsage limit="1 gb"/>
				</tempUsage>
			</systemUsage>
		</systemUsage>

		<transportConnectors>
			
			<transportConnector name="vm" uri="vm://localhost"/>
			
			<transportConnector name="tcp" uri="tcp://0.0.0.0:61616"/>
		</transportConnectors>
		
		<plugins>
			<jaasAuthenticationPlugin configuration="activemq" />
		</plugins>

	</broker>

	<import resource="jetty.xml"/>
	
	<camel:camelContext xmlns="http://camel.apache.org/schema/spring"
trace="true" id="AMQCamel" streamCache="true">
		<packageScan>
			<package>de.testproject</package>
		</packageScan>
	</camel:camelContext>
	
	
	<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="connectionFactory" ref="amqConFac"/>
		<property name="transacted" value="true"/>
		<property name="transactionManager" ref="txManager"/>
		<property name="testConnectionOnStartup" value="true"/>
	</bean>
	
	<bean id="txManager"
class="org.springframework.jms.connection.JmsTransactionManager">
		<property name="connectionFactory" ref="amqConFac" />
	</bean>
	
	
	
	<bean id="activemqWithoutTransactions"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="connectionFactory" ref="amqConFacWithoutTransactions"/>
		<property name="testConnectionOnStartup" value="true"/>
	</bean>
	
	
	
	<bean id="amqConFac" class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL" value="vm://localhost" />
		<property name="userName" value="admin"/>
		<property name="password" value="admin"/>
	</bean>
	
	<bean id="amqConFacWithoutTransactions"
class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL" value="vm://localhost" />
		<property name="userName" value="admin"/>
		<property name="password" value="admin"/>
	</bean>
	
	
	<bean id="StartupInitBean" class="de.testproject.VMStartStop"
init-method="startUp" destroy-method="cleanUp"/>
</beans>




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-KahaDB-Directory-tp4706593p4706780.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message