activemq

【数据库】Cannot create PoolableConnectionFactory (null, message from server: "Host 'xxxxx' isnot allow

ⅰ亾dé卋堺 提交于 2020-02-26 15:39:28
1.问题出现 在学习activemq的时候,配置activemq去连接mysql 但是activemq一起动就报错误连接不到mysql 说不允许连接。 java.io.IOException: Cannot create PoolableConnectionFactory (null, message from server: "Host '192.168.58.134' is not allowed to connect to this MySQL server") 2.问题分析 是mysql对用于进行限制远程客户端连接。修改一下就可以了。 3.问题解决 mysql > grant all privileges on db_name.* to usr_name@'%' identified by 'pwd'; 其中,db_name 是数据库名, usr_name 用户名, pwd 密码。'%' 为通配符。 mysql > flush privileges ; 4.参考博客 https://blog.csdn.net/timo1160139211/article/details/72831771 来源: CSDN 作者: Jayiiiiii 链接: https://blog.csdn.net/jia970426/article/details/104516383

ActiveMQ学习之增加NIO通讯协议

拥有回忆 提交于 2020-02-26 13:15:05
一、修改activemq.xml 1、进入到activemq的安装目录下 2、进入conf文件夹中 3、对activemq.xml文件进行编辑 4、增加NIO协议 <transportConnector name="nio" uri="nio://0.0.0.0:61618?trace=true"/> 5、保存并退出 二、启动activemq(正常启动就可以) 三、生产者 import org.apache.activemq.ActiveMQConnectionFactory; import javax.jms.*; /** * @ProjectName: springbootActiveMQ * @Package: cn.**.test * @Author: huat * @Date: 2020/1/2 17:04 * @Version: 1.0 */ public class ActiveMQTest { //url路径 private static final String ACTRIVE_URL="nio://192.168.44.135:61618"; //队列名称 private static final String QUEUE_NAME="queue01"; public static void main(String[] args) { //1、创建连接工厂 /

ActiveMQ学习之通讯协议

只谈情不闲聊 提交于 2020-02-26 09:42:45
一、支持的通讯协议 ActiveMQ支持的client-broker通讯协议有:TCP、NIO、UDP、SSL、HTTP(S)、VM 其中配置Transport Connector的文件在ActiveMQ安装目录的conf/activemq.xml中的<TransportConnectors>标签内 上图中给出的配置信息中 url描述信息的头部都是采用协议名称:例如上图给出的 描述amqp协议的监听端口时,采用的url描述格式为“amqp://........” 描述stomp协议的监听端口时,采用的url描述格式为“stomp://........” 唯独在进行openwire协议进行描述时,url头部采用的是"tcp://........"这是因为activeMQ中默认的消息协议就是openwire 二、Transmission Control Protocol(TCP) 1、这是默认的broker配置,TCP的Client监听的端口为61616 2、在网络传输协议之前,必须要序列化数据,消息是通过一个叫wire protocol的来序列化成字节流, 默认情况下 ActiveMQ默认把wire protocol叫做openwire,目的是促使网络上的效率和数据进行快速交互 3、TCP连接的url形式如下:“tcp://hostname:port?key=value&key

ActiveMQ学习之SpringBoot整合ActiveMQ------>主题生产者和消费者

旧街凉风 提交于 2020-02-26 08:00:39
一、pom <!--聚合工程集成关系--> <!--统一整合第三方框架依赖信息--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE</version> </parent> <dependencies> <!-- -springboot 整合Web组件 整合SpringMVC 就会把传统方式的SpringMVC依赖的jar全部给下载来 --> <!-- 引入spring-boot-starter-web 帮你整合好所有相关的依赖jar包 原理 maven依赖传递 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--springboot整合activeMQ--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId>

ActiveMQ学习之Spring整合ActiveMQ------>消息主题

耗尽温柔 提交于 2020-02-26 07:44:08
一、pom <dependencies> <!--activemq--> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> <version>5.15.9</version> </dependency> <!--activeMQ对jms的支持,整合spring和activemq--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>4.3.23.RELEASE</version> </dependency> <!--activeMQ所需要的pool--> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> <version>5.15.9</version> </dependency> <!--fastjson--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson

ActiveMQ学习之Spring整合ActiveMQ------>消息队列

时光毁灭记忆、已成空白 提交于 2020-02-26 05:04:10
一、pom <dependencies> <!--activemq--> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> <version>5.15.9</version> </dependency> <!--activeMQ对jms的支持,整合spring和activemq--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>4.3.23.RELEASE</version> </dependency> <!--activeMQ所需要的pool--> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> <version>5.15.9</version> </dependency> <!--fastjson--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson

MQ优缺点及不同组件的区别

和自甴很熟 提交于 2020-02-25 22:06:17
为什么使用消息中间件? 消息队列核心使用场景<优点>: 解耦、异步、削峰 (1)解耦 传统模式: 传统模式的缺点: 系统间耦合性太强,如上图所示,系统A在代码中直接调用系统B和系统C的代码,如果将来D系统接入,系统A还需要修改代码,过于麻烦! 中间件模式: 中间件模式的的优点: 将消息写入消息队列,需要消息的系统自己从消息队列中订阅,从而系统A不需要做任何修改。 (2)异步 传统模式: 传统模式的缺点: 一些非必要的业务逻辑以同步的方式运行,太耗费时间。 中间件模式: 中间件模式的的优点: 将消息写入消息队列,非必要的业务逻辑以异步的方式运行,加快响应速度 (3)削峰 传统模式 传统模式的缺点: 并发量大的时候,所有的请求直接怼到数据库,造成数据库连接异常 中间件模式: 中间件模式的的优点: 系统A慢慢的按照数据库能处理的并发量,从消息队列中慢慢拉取消息。在生产中,这个短暂的高峰期积压是允许的。 消息中间件缺点有哪些? 系统可用性降低 系统引入的外部依赖越多,越容易挂掉,需要保证消息队列的高可用。 系统复杂度提高 多一个 MQ 组件,那就需要面对 消息没有重复消费,处理消息丢失的情况,保证消息传递的顺序性等等系统级别问题。 一致性问题 多个消费者消费某一个消息就可能出现个别消费失败的情况,会出现数据不一致。 ActiveMQ、RabbitMQ、RocketMQ、Kafka

How to create listner REST consumer in ActiveMQ

我的梦境 提交于 2020-02-25 05:35:17
问题 I have created ActiveMQ consumer as follow in order consume queued item but my problem is how can I keep checking on this queue since content publishing to this perticular queue can happen anytime but I can't keep listening to the queue since I'm using rest client GET method(HTTP) (NOT jms TCP connection), using infinite loop is no solution for me. Is there any out of the box solution for this other than custom solution within the ActiveMQ rest inteface PropertyResourceBundle prop =

初入Mq

本小妞迷上赌 提交于 2020-02-24 13:54:06
一. 什么是消息中间件 利用高效可靠的消息传递机制进行平台无关的数据交流; 并给予数据通信来进行分布式系统的集成; 通过提供消息传递和消息排队模型,它可以在分布式环境下扩展进程间的通信。 二.消息中间件应用场景 1.跨系统数据传递 2.高并发流量的削峰, 3.数据的异步处理。 三.常用消息中间件 ActiveMQ:由Apache纯用java进行开发的消息中间件,存在的时间久远,完全遵循JMS进行开发。 RabbitMQ:支持的消息分发机制最全,使用Erlang语言进行开发的 Kafka:使用scala和java进行开发的语言,为了弥补Activemq的吞吐量低而进行开发的语言。具有高吞吐量的特点,可以和Hadoop结合。进行大数据的开发。 RocketMQ:由阿里使用java开发的一个高性能分布式,经受了双十一的考验。 四.消息中间件核心设计及各部分概述 本质:一种具有接受请求,保存数据,发送数据等功能的网络应用和一般网络应用程序的区别是它主要负责数据的接受和传递,所以性能优于普通程序。 1.协议(语法,语义,同步) : OpenWire :ActiveMQ专属 AMQP :事务支持,持久化支持,出生于金融,可靠性高(RabbitMQ,ACTIVEMQ) MQTT :即时通讯协议,主要用去物联网,轻量级,结构简单,传输快,不支持事务,没有持久化相关设计。适用于计算能力有限低带宽

What's a quick way to trace the entry and exit of functions in a Visual Studio 2005 c++ multithreaded program?

送分小仙女□ 提交于 2020-02-24 05:53:06
问题 I have intermittent crashes occurring in my ActiveMQ libraries due to the way I'm using the activemq-cpp API. It'd be much easier to debug the issue if I could observe every function being called leading up to the crash. Are there any quick ways to trace the entry and exit of functions in a Visual Studio 2005 c++ multithreaded program? Thanks in advance! 回答1: Use a Tracer object. Something like this: class Tracer { public: Tracer(const char *functionName) : functionName_(functionName) { cout