- 浏览: 983701 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (826)
- 硬件 (8)
- 软件 (24)
- 软件工程 (34)
- JAVA (229)
- C/C++/C# (77)
- JavaScript (8)
- PHP (1)
- Ruby (3)
- MySQL (14)
- 数据库 (19)
- 心情记事 (12)
- 团队管理 (19)
- Hadoop (1)
- spring (22)
- mybatis(ibatis) (7)
- tomcat (16)
- velocity (0)
- 系统架构 (6)
- JMX (8)
- proxool (1)
- 开发工具 (16)
- python (10)
- JVM (27)
- servlet (5)
- JMS (26)
- ant (2)
- 设计模式 (5)
- 智力题 (2)
- 面试题收集 (1)
- 孙子兵法 (16)
- 测试 (1)
- 数据结构 (7)
- 算法 (22)
- Android (11)
- 汽车驾驶 (1)
- lucene (1)
- memcache (12)
- 技术架构 (7)
- OTP-Erlang (7)
- memcached (17)
- redis (20)
- 浏览器插件 (3)
- sqlite (3)
- Heritrix (9)
- Java线程 (1)
- scala (0)
- Mina (6)
- 汇编 (2)
- Netty (15)
- libevent (0)
- CentOS (12)
- mongod (5)
- mac os (0)
最新评论
-
kingasdfg:
你这里面存在一个错误添加多个任务 应该是这样的 /** * ...
Quartz的任务的临时启动和暂停和恢复【转】 -
kyzeng:
纠正一个错误,long型对应的符号是J,不是L。
Jni中C++和Java的参数传递 -
zhaohaolin:
抱歉,兄弟,只是留下作记录,方便学习,如果觉得资料不好,可以到 ...
netty的个人使用心得【转】 -
cccoooccooco:
谢谢!自己一直以为虚机得使用网线才可以与主机连接呢。。
主机网卡无网线连接与虚拟机通信 -
yuqilin001:
要转别人的东西,请转清楚点嘛,少了这么多类,误人子弟
netty的个人使用心得【转】
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- START SNIPPET: example -->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:///${activemq.base}/conf/credentials.properties</value>
</property>
</bean>
<!-- 下面红色字体是为了支持带数据库的主从模式集群的配置,被注释的蓝色字体是系统默认配置,单个activemq是用默认的. -->
<broker xmlns="http://activemq.org/config/1.0" brokerName="JdbcMasterBroker" persistent="true" useShutdownHook="false">
<!--<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" > -->
<!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" memoryLimit="5mb"/>
<policyEntry topic=">" memoryLimit="5mb">
<!-- you can add other policies too such as these
<dispatchPolicy>
<strictOrderDispatchPolicy/>
</dispatchPolicy>
<subscriptionRecoveryPolicy>
<lastImageSubscriptionRecoveryPolicy/>
</subscriptionRecoveryPolicy>
-->
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<!-- The store and forward broker networks ActiveMQ will listen to -->
<networkConnectors>
<!-- by default just auto discover the other brokers -->
<!-- <networkConnector name="default-nc" uri="multicast://default"/> -->
<!-- Example of a static configuration:-->
<!-- <networkConnector uri="static://(tcp://localhost:61616,tcp://192.168.2.136:61616)"/>-->
</networkConnectors>
<!-- 下面的配置是和上面的“persistnet=true”相配合使用的。-->
<persistenceAdapter>
<amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb"/>
</persistenceAdapter>
<!-- Use the following if you wish to configure the journal with JDBC -->
<!--
<persistenceAdapter>
<journaledJDBC dataDirectory="${activemq.base}/data" dataSource="#postgres-ds"/>
</persistenceAdapter>
-->
<!-- Or if you want to use pure JDBC without a journal -->
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#mysql-ds"/>
</persistenceAdapter>
<!--
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#postgres-ds"/>
</persistenceAdapter>
-->
<sslContext>
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" trustStorePassword="password"/>
</sslContext>
<!-- The maximum about of space the broker will use before slowing down producers -->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
</transportConnectors>
</broker>
<!--
** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
** For more details see
**
** http://activemq.apache.org/enterprise-integration-patterns.html
-->
<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<!-- You can use a <package> element for each root package to search for Java routes -->
<package>org.foo.bar</package>
<!-- You can use Spring XML syntax to define the routes here using the <route> element -->
<route>
<from uri="activemq:example.A"/>
<to uri="activemq:example.B"/>
</route>
</camelContext>
<!--
** Lets configure some Camel endpoints
**
** http://activemq.apache.org/camel/components.html
-->
<!-- configure the camel activemq component to use the current broker -->
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
<property name="userName" value="${activemq.username}"/>
<property name="password" value="${activemq.password}"/>
</bean>
</property>
</bean>
<!-- Uncomment to create a command agent to respond to message based admin commands on the ActiveMQ.Agent topic -->
<!--
<commandAgent xmlns="http://activemq.apache.org/schema/core" brokerUrl="vm://localhost" username="${activemq.username}" password="${activemq.password}"/>
-->
<!-- An embedded servlet engine for serving up the Admin console -->
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
<connectors>
<nioConnector port="8161"/>
</connectors>
<handlers>
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
<webAppContext contextPath="/demo" resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
</handlers>
</jetty>
<!-- This xbean configuration file supports all the standard spring xml configuration options -->
<!-- Postgres DataSource Sample Setup -->
<!--
<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
<property name="serverName" value="localhost"/>
<property name="databaseName" value="activemq"/>
<property name="portNumber" value="0"/>
<property name="user" value="activemq"/>
<property name="password" value="activemq"/>
<property name="dataSourceName" value="postgres"/>
<property name="initialConnections" value="1"/>
<property name="maxConnections" value="10"/>
</bean>
-->
<!-- MySql DataSource Sample Setup -->
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://192.168.2.136:3306/activemq?relaxAutoCommit=true"/>
<property name="username" value="app"/>
<property name="password" value="app"/>
<property name="maxActive" value="200"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
<!-- Oracle DataSource Sample Setup -->
<!--
<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/>
<property name="username" value="scott"/>
<property name="password" value="tiger"/>
<property name="maxActive" value="200"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
-->
<!-- Embedded Derby DataSource Sample Setup -->
<!--
<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
<property name="databaseName" value="derbydb"/>
<property name="createDatabase" value="create"/>
</bean>
-->
</beans>
<!-- END SNIPPET: example -->
已主从模式运行(192.168.2.137为主,192.168.2.136为从),还需在客户端上运行如下命令:
java.naming.provider.url=failover:(tcp://192.168.2.137:61616,tcp://192.168.2.136:61616)?
randomize=false #没有这一行的话,就变成了networks of brokers
initialReconnectDelay=10 #这里的单位是毫秒
activemq的目录里有个example,只要简单配置一下build.xml,即可测试activemq的message的consume和query
<project name="Inbox" default="help" basedir=".">
<property name="class.dir" value="target/classes" />
<property name="activemq.home" value=".." />
<!-- 作为消息consume的使用本地地址,作为消息query的使用consumer的ip地址 -->
<!-- example program defaults -->
<property name="url" value="tcp://localhost:61616" />
发表评论
-
Advanced Message Queuing Protocol ( 3 ) 逻辑模型
2011-05-07 22:04 1123Sessions 建立在不同容器中的两个节点的链接必 ... -
Advanced Message Queuing Protocol ( 2 ) 逻辑模型
2011-05-07 22:04 938Nodes and Links 一个AMQP的网络包 ... -
Advanced Message Queuing Protocol ( 1 ) 概述
2011-05-07 22:03 1163The Advanced Message Queuing ... -
Apache Qpid (1) -- build
2011-05-07 22:02 1903http://qpid.apache.org/index.h ... -
ActiveMQ技术预研报告【转】
2011-04-22 14:44 1869ActiveMQ技术预研报告 研究部朱懋柱 1.文 ... -
ActiveMQ与MSMQ的异同【转】
2011-04-22 14:14 1876.NET下发送和接收ActiveMQ A:下载Act ... -
ActiveMQ在C#中的应用
2011-04-21 16:18 1157ActiveMQ 是个好东东,不必多说。ActiveM ... -
ActiveMQ实战之 Queue点对点消息【转】
2011-04-18 23:15 1171对于此类消息,其实就是指使用JMS中的发P2P(点对点)消息模 ... -
ActiveMQ实战之 Topic发布订阅消息【转】
2011-04-18 23:14 1154对于此类消息,其实就是指使用JMS中的发布订阅消息模型的消息, ... -
ActiveMQ实战(4):JMS的安全性【转】
2011-04-18 22:52 1187对于JMS服务的安全控制,ActiveMQ提供两种方式:简单授 ... -
ActiveMQ实战(3):Web控制台的安全性【转】
2011-04-18 22:52 1302安装好ActiveMQ后,其默认没有任何安全控制,任何人都可以 ... -
ActiveMQ实战(2):测试其是否正常工作【转】
2011-04-18 22:51 1168既然ActiveMQ安装好了并启动成功,接下来我们就编写一个测 ... -
ActiveMQ实战(1):安装与运行【转】
2011-04-18 22:45 1748ActiveMQ的项目主页:http://activemq.a ... -
[转] JMS开源比较
2011-03-30 23:46 1142Java开源JMS消息中间件 ... -
activemq5.2发送和接收BlobMessage简单实例
2011-03-29 23:45 1104package com.work.activemq ... -
ActiveMQ学习笔记----ActiveMQ和JBossMQ性能对比测试代码
2011-03-29 23:44 1192本文描述了对ActiveMQ进行性能测试的代码。性能测试用 ... -
ActiveMQ 实例
2011-03-29 23:21 9962009-06-24 ProducerTool.java ... -
ActiveMQ持久化消息的三种方式
2011-03-29 09:11 13291:前言 这一段给公司开发消息总线有机会研究A ... -
什么是JMS(Java消息服务)
2011-03-28 19:28 866在不同系统之间交换信息的一大障碍是如何在精确交换和格式化数据方 ... -
消息中间件和JMS
2011-03-28 19:26 761当前,CORBA、DCOM、RMI等R ...
相关推荐
ActiveMQ配置Mysql8为持久化方式所需Jar包
NULL 博文链接:https://showlike.iteye.com/blog/2000117
activemq-5.15.15 JDBC持久化mysql8.0+的activemq.xml
NULL 博文链接:https://ims.iteye.com/blog/2367066
spring +activemq topic消息持久化订阅实例,整个项目中有activemq和spring的整合的所有实例,topic的持久化配置是在ApplicationContext3C、ApplicationContext3C2以及ApplicationContext3P三个中,消息生产者:...
该文档详细描述了linux环境下的 Activemq 持久化、集群环境的搭建步骤,以及测试步骤
一个订阅通道,支持多个客户端监听,当某个客户端掉线后,再上线的时候可以收到它没有接收到的消息。
本人在学习activemq,然后 测试完成的demo, 包含了queue,topic,持久化到mysql,订阅模式,包好用
ActiveMQ配置说明,包括java内存调整,主从集群配置,自动清理离线客户端(避免长时间持久订阅占用内存)等
ActiveMQ的持久化(数据库)[归类].pdf
activemq消息持久化所需Jar包,亲测可用https://blog.csdn.net/weixin_42109071/article/details/91349406
linux下activemq安装包和配置文档
ActiveMQ安装及配置文档介绍了ActiveMQ的安装过程和配置。让新手踏入JMS的门槛。
activeMQ-5.15版本,里面更改了activeMQ配置,新增了mysql的连接内容。lib里添加了durid和mysql连接的jar文件
activemq+springMVC+mysql 应用实例(完整工程,创建数据库后可用) eclipse导入后,创建数据库,配置tomcat后启动即可使用 创建数据库的语句如下: create database activemq; use activemq; create table user ...
用于ACtiveMq 配置插件配置使用,配置介绍等,适合初学者
activemq 配置的相关文档,助你完善activeMQ的配置
activemq消息持久化所需Jar包,详情请参见博文:http://blog.csdn.net/l1028386804/article/details/68997105
activemq服务器使用的zookeeper replicable 的方式进行负载均衡以及容灾,客户端使用spring进行配置
详细描述了ActiveMQ消息过期-时间设置和自动清除解决方案。