topic

AWS SNS get topic by name

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I think that it's a very inefficient way to get a topic ARN, and I'd like to know if there is a most efficient way to get this information, like a function getTopicByName or something else. If not, I'd like to know if ARN is immutable, and if can I store the topic ARN on my database? Thanks. 回答1: I don't know of any way to look up an SNS topic by name. The ARN is immutable. It will not change for the life of the SNS topic. In particular, according to the documentation an ARN for an SNS topic is in the following format: arn:aws:sns:region

(java.lang.String) cannot be applied to (java.lang.Object)

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Ive a Listner class called TopicS Im trying to call it from a gui called readMessages When Im trying to run the class TopicS using the following method, private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { System.out.println("test test test"); System.out.print("you pressed" +topicCombobox.getSelectedItem()); TopicS a = new TopicS(); a.addTopicToListner(topicCombobox.getSelectedItem()); } It gives me error saying addTopicListner(java.lang.String) in Topics Cannot be applied to (java.lang.Object) When I change the String to

RabbitMQ使用介绍5—Topics

不羁岁月 提交于 2019-12-03 07:27:12
Topics 在之前的教程中我们改进了日志系统,然而使用fanout exchange 仅是可以广播,我们使用direct选择的接收日志。即使使用direct exchange改善我们的系统,它仍然是有限的,不能基于多个条件进行路由。 在我们的系统中我们想要订阅不仅是严重程度的日志,而且还基于发出日志的资源,您可能从syslog unix工具中了解了这个概念,该工具根据严重性(info / warn / crit ...)和工具(auth / cron / kern ...)路由日志。这将为我们提供很大的灵活性-我们可能只想听来自“ cron”的严重错误,也可以听“ kern”的所有日志。 *(star)可以替代一个单词(字) (hash)可以代替一个或者多个单词(字) 如图解释 topic_send.py # -*- coding: utf-8 -*- ''' @Time : 19-11-1 下午3:41 @Author : jz @FileName: topic_send.py @Software: PyCharm ''' import pika import sys connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) channel = connection

Kafka Connect简介

笑着哭i 提交于 2019-12-03 04:56:08
Kafka Connect简介 http://colobu.com/2016/02/24/kafka-connect/#more Kafka 0.9+增加了一个新的特性 Kafka Connect ,可以更方便的创建和管理数据流管道。它为Kafka和其它系统创建规模可扩展的、可信赖的流数据提供了一个简单的模型,通过 connectors 可以将大数据从其它系统导入到Kafka中,也可以从Kafka中导出到其它系统。Kafka Connect可以将完整的数据库注入到Kafka的Topic中,或者将服务器的系统监控指标注入到Kafka,然后像正常的Kafka流处理机制一样进行数据流处理。而导出工作则是将数据从Kafka Topic中导出到其它数据存储系统、查询系统或者离线分析系统等,比如数据库、 Elastic Search 、 Apache Ignite 等。 Kafka Connect特性包括: Kafka connector通用框架,提供统一的集成API 同时支持分布式模式和单机模式 REST 接口,用来查看和管理Kafka connectors 自动化的offset管理,开发人员不必担心错误处理的影响 分布式、可扩展 流/批处理集成 流数据平台 基于Kafka, LinkedIn等一些大公司已经建立起架构类似的、可扩展的流数据平台。它包含两个功能,数据集成和流处理。 Kafka

Kafka Manager安装部署及使用

落花浮王杯 提交于 2019-12-03 04:29:18
为了简化开发者和服务工程师维护Kafka集群的工作,yahoo构建了一个叫做Kafka管理器的基于Web工具,叫做 Kafka Manager。本文对其进行部署配置,并安装配置kafkatool对kafka进行监控、查询 一、kafka-manager 简介 为了简化开发者和服务工程师维护Kafka集群的工作,yahoo构建了一个叫做Kafka管理器的基于Web工具,叫做 Kafka Manager。这个管理工具可以很容易地发现分布在集群中的哪些topic分布不均匀,或者是分区在整个集群分布不均匀的的情况。它支持管理多个集群、选择副本、副本重新分配以及创建Topic。同时,这个管理工具也是一个非常好的可以快速浏览这个集群的工具,有如下功能: 1.管理多个kafka集群 2.便捷的检查kafka集群状态(topics,brokers,备份分布情况,分区分布情况) 3.选择你要运行的副本 4.基于当前分区状况进行 5.可以选择topic配置并创建topic(0.8.1.1和0.8.2的配置不同) 6.删除topic(只支持0.8.2以上的版本并且要在broker配置中设置delete.topic.enable=true) 7.Topic list会指明哪些topic被删除(在0.8.2以上版本适用) 8.为已存在的topic增加分区 9.为已存在的topic更新配置 10

Topic can't be found when producing messages: UNKNOWN_TOPIC_OR_PARTITION

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a two-nodes kafka cluster (EC2 instances) where each node is used as a separate broker. When I run a producer on the leader instance with the following command: kafka-console-producer.sh --broker-list localhost:9092 --topic test I get the following errors. test message [2017-01-09 13:22:39,483] WARN Error while fetching metadata with correlation id 0 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient) [2017-01-09 13:22:39,562] WARN Error while fetching metadata with correlation id 1 : {test=UNKNOWN_TOPIC_OR

Spark MLlib LDA, how to infer the topics distribution of a new unseen document?

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am interested in applying LDA topic modelling using Spark MLlib. I have checked the code and the explanations in here but I couldn't find how to use the model then to find the topic distribution in a new unseen document. 回答1: As of Spark 1.5 this functionality has not been implemented for the DistributedLDAModel . What you're going to need to do is convert your model to a LocalLDAModel using the toLocal method and then call the topicDistributions(documents: RDD[(Long, Vector]) method where documents are the new (i.e. out-of-training)

Kafka介绍

心不动则不痛 提交于 2019-12-03 03:01:21
作用: 系统之间解耦和 峰值压力缓冲 异步通信 特点:生产者消费者模式,先进先出(FIFO)保证顺序,自己不丢数据,默认每隔7天清理数据,高吞吐量,没有主从关系,依靠Zk协调 结构: topic:消息队列/分类   kafka里面的消息是有topic来组织的,简单的我们可以想象为一个队列,一个队列就是一个topic,然后它把每个topic又分为很多个partition(自己指定),这个是为了 做并行 的,在每个partition内部消息强有序,相当于有序的队列,其中每个消息都有个序号offset,比如0到12,从前面读往后面写。 一个partition对应一个broker,一个broker可以管多个partition ,比如说,topic有6个partition,有两个broker,那每个broker就管3个partition。这个partition可以很简单想象为 一个文件 , 位置信息叫offset ,当数据发过来的时候它就往这个partition上面append,追加就行,消息不经过内存缓冲, 直接写入磁盘(零拷贝技术) ,kafka和很多消息系统不一样,很多消息系统是消费完了我就把它删掉,而kafka是根据时间策略删除,而不是消费完就删除,在kafka里面没有一个消费完这么个概念,只有过期这样一个概念。   producer自己决定往哪个partition里面去写

Java, How to get number of messages in a topic in apache kafka

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using apache kafka for messaging. I have implemented the producer and consumer in Java. How can we get the number of messages in a topic? 回答1: The only way that comes to mind for this from a consumer point of view is to actually consume the messages and count them then. The Kafka broker exposes JMX counters for number of messages received since start-up but you cannot know how many of them have been purged already. In most common scenarios, messages in Kafka is best seen as an infinite stream and getting a discrete value of how many

How can I publish to a MQTT topic in a Amazon AWS Lambda function?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to have an easy command like I use in the bash to publish something to a topic on MQTT inside a AWS Lambda function. Along the lines of: mosquitto_pub -h my.server.com -t "light/set" -m "on" Background: I would like to turn a lamp on and off with Alexa. Alexa can start a Lambda function, and inside of this Lambda function I would like to start an MQTT publish, because the lamp can listen to a MQTT topic and react on the messages there.(Maybe there are easier solutions, but we are in a complicated (university) network which makes