- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Cygnus 模块上遇到了一个奇怪的行为。我正在使用 Context Broker 0.28 版和 Cygnus 0.13 版。假设我在 CB(上下文代理)上加载了一些与此类似的实体:
(curl 172.21.0.33:1026/v1/updateContext -s -S
--header 'Fiware-Service: cb33_1003_06'
--header 'Fiware-ServicePath: /Lugar'
--header 'Content-Type: application/json'
--header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
"contextElements": [
{
"type": "Acceso_Wifi",
"isPattern": "false",
"id": "AP_1.3",
"attributes": [
{
"name": "temperature",
"type": "float",
"value": "25"
},
{
"name": "pressure",
"type": "integer",
"value": "1"
},
{
"name": "position",
"type": "coords",
"value": "13.322326, -1.983824",
"metadatas": [
{
"name": "location",
"type": "string",
"value": "WGS84"
}
]
}
]
}
],
"updateAction": "APPEND"
}
EOF
(curl 172.21.0.33:1026/v1/subscribeContext -s -S
--header 'Fiware-Service: cb33_1003_06'
--header 'Fiware-ServicePath: /Lugar'
--header 'Content-Type: application/json'
--header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
"entities": [
{
"type": "Acceso_Wifi",
"isPattern": "true",
"id": "AP_.*"
}
],
"attributes": [
"temperature",
"pressure"
],
"reference": "http://172.21.0.33:5050/notify",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": []
}
],
"throttling": "PT1S"
}
EOF
cygnus2_/Lugar__Lugar__Lugar_AP_1.1_Acceso_Wifi
cygnus2_/Lugar__Lugar__Lugar_AP_1.2_Acceso_Wifi
cygnus2_/Lugar__Lugar__Lugar_AP_1.3_Acceso_Wifi
cygnus2_/Lugar_AP_1.1_Acceso_Wifi
cygnus2_/Lugar__Lugar__Lugar_AP_1.1_Acceso_Wifi
cygnus2_/Lugar__Lugar__Lugar_AP_1.2_Acceso_Wifi
cygnus2_/Lugar__Lugar__Lugar_AP_1.3_Acceso_Wifi
org.apache.flume.source.http.HTTPBadRequestException: 'fiware-servicePath' header length greater than 50)
at com.telefonica.iot.cygnus.handlers.OrionRestHandler.getEvents(OrionRestHandler.java:209)
at org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet.doPost(HTTPSource.java:184)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
# OrionMongoSink configuration
# sink class, must not be changed
cygnusagent.sinks.mongo-sink.type = com.telefonica.iot.cygnus.sinks.OrionMongoSink
# channel name from where to read notification events
cygnusagent.sinks.mongo-sink.channel = mongo-channel
# true if the grouping feature is enabled for this sink, false otherwise
cygnusagent.sinks.mongo-sink.enable_grouping = false
# true if lower case is wanted to forced in all the element names, false otherwise
cygnusagent.sinks.mongo-sink.enable_lowercase = false
# FQDN/IP:port where the MongoDB server runs (standalone case) or comma-separated list of FQDN/IP:port pairs where the MongoDB replica set members run
cygnusagent.sinks.mongo-sink.mongo_hosts = mongodb1.spider.net:27017,mongodb2.spider.net:27017,mongodb3.spider.net:27017
###cygnusagent.sinks.mongo-sink.mongo_hosts = 172.21.0.25:27017,172.21.0.26:27017,172.21.0.28:27017
# a valid user in the MongoDB server (or empty if authentication is not enabled in MongoDB)
cygnusagent.sinks.mongo-sink.mongo_username =
# password for the user above (or empty if authentication is not enabled in MongoDB)
cygnusagent.sinks.mongo-sink.mongo_password =
# prefix for the MongoDB databases
cygnusagent.sinks.mongo-sink.db_prefix = cygnus2_
# prefix pro the MongoDB collections
cygnusagent.sinks.mongo-sink.collection_prefix = cygnus2_
# true is collection names are based on a hash, false for human redable collections
cygnusagent.sinks.mongo-sink.should_hash = false
# Must be dm-by-service-path or dm-by-entity
cygnusagent.sinks.mongo-sink.data_model = dm-by-entity
# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.mongo-sink.attr_persistence = column
# number of notifications to be included within a processing batch
cygnusagent.sinks.mongo-sink.batch_size = 1
# timeout for batch accumulation
cygnusagent.sinks.mongo-sink.batch_timeout = 30
# number of retries upon persistence error
cygnusagent.sinks.mongo-sink.batch_ttl = 10
# Collections will be removed if older than the value specified in seconds. Set to 0 if not wanting this policy.
cygnusagent.sinks.mongo-sink.data_expiration = 0
# The oldest data (according to insertion time) will be removed if the size of the data collection gets bigger than the value specified in bytes. Minimum value (different than 0) is 4096 bytes.
cygnusagent.sinks.mongo-sink.collection_size = 0
# The oldest data (according to insertion time) will be removed if the number of documents in the data collections goes beyond the specified value. Set to 0 if not wanting this policy
cygnusagent.sinks.mongo-sink.max_documents = 0
# source configuration
# channel name where to write the notification events
#####cygnusagent.sources.http-source.channels = hdfs-channel mysql-channel postgresql-channel ckan-channel mongo-channel sth-channel kafka-channel
cygnusagent.sources.http-source.channels = mongo-channel
# source class, must not be changed
cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
# listening port the Flume source will use for receiving incoming notifications
cygnusagent.sources.http-source.port = 5050
# Flume handler that will parse the notifications, must not be changed
cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler
# URL target
cygnusagent.sources.http-source.handler.notification_target = /notify
# Default service (service semantic depends on the persistence sink)
cygnusagent.sources.http-source.handler.default_service = def_serv
# Default service path (service path semantic depends on the persistence sink)
cygnusagent.sources.http-source.handler.default_service_path = def_serv_path
# Number of channel re-injection retries before a Flume event is definitely discarded (-1 means infinite retries)
cygnusagent.sources.http-source.handler.events_ttl = -1
# Source interceptors, do not change
cygnusagent.sources.http-source.interceptors = ts gi
# TimestampInterceptor, do not change
cygnusagent.sources.http-source.interceptors.ts.type = timestamp
# GroupinInterceptor, do not change
cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
# Grouping rules for the GroupingInterceptor, put the right absolute path to the file if necessary
# See the doc/design/interceptors document for more details
#####cygnusagent.sources.http-source.interceptors.gi.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf
# mongo-channel configuration
# channel type (must not be changed)
cygnusagent.channels.mongo-channel.type = memory
# capacity of the channel
cygnusagent.channels.mongo-channel.capacity = 10000
# amount of bytes that can be sent per transaction
cygnusagent.channels.mongo-channel.transactionCapacity = 100
最佳答案
在与 Orion 专家交谈后,这似乎是初始通知的问题,即创建订阅并发送第一个通知时;在这种情况下,多值 fiware-servicePath
已发送。然而,在那之后,下一个通知应该包含一个上下文元素,因此,一个单值 fiware-servicePath
标题。
这需要在代码中进行修复(要么忽略第一个通知,顺便说一句,这是无用的,要么通过支持多值服务路径 header )。同时,一种解决方法是停止对 Cygnus 的订阅,一旦完成所有订阅,就启动 Cygnus。
编辑1:
我在 Cygnus Github 上创建了这个问题:https://github.com/telefonicaid/fiware-cygnus/issues/923
关于Fiware - Cygnus : Issue with collection's names,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35921306/
是否有带有索引的.collect?我想做这样的事情: def myList = [ [position: 0, name: 'Bob'], [position: 0, name: 'J
我创建了一个 Collection 类,它扩展了 ArrayList 以添加一些有用的方法。它看起来像这样: public class Collection extends ArrayList {
我知道如果我有元素,我想得到 List/Set/Map 我可以调用这个元素: Collections.singleton()/Collections.singletonList()/Collectio
我刚刚在我的 pom 文件中看到 Apache commons-collections 有两个不同的组 ID: commons-collections commons-collect
我们可以对所有 Collections 类型的对象(如 Set 和 List)使用 Collections.synchronizedCollection(Collection c),这就是为什么我们有
我有List>我想让它把上一个集合中的所有人复制到List收藏。 我是这样做的: var People = new List>{ new List{...},... };
我想做的是使用良好的旧循环非常简单。 假设我有一个包含 B 列表的对象 A。 public class A { public List myListOfB; } 在其他一些方法中,我有一个 As
在 Capgemini 的采访中,我被问到一个我无法回答的问题。所有集合类和接口(interface)共有的那些方法是什么? 最佳答案 所有 java 对象类(包括所有集合)都派生自名为 Object
我有一系列存储估计信息的数据库表。当设置某些边界时,我试图从所有数据库表中返回所有数据。 收藏 $estimateItems = new Collection(); $esti
为什么 Haskell 实现如此专注于链表? 例如,我知道 Data.Sequence 效率更高 大多数列表操作(cons 操作除外),并且被大量使用; 但是,从语法上讲,它“几乎不受支持”。 Has
我试图简单地将我在 PHP 中请求的内容返回到 JSON。我的问题是每个库存尚未完成。事实上,它是“渲染”,但“this.collection.models”尚未完成,因为请求尚未完成。 我应该如何解
本质上,作为Powershell脚本的一部分,我需要实现广度优先搜索。因此,我需要队列,并且认为System.Collections.Queue与其他任何队列一样好。但是,当我从队列中取出一个对象时,
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是 on-topic用于堆栈溢出。 已关闭10 年前。 Improve t
嗨,我不明白为什么这不起作用? Notifications.update({'userId':Meteor.userId(), 'notifyUserId':notifyFriendId}, {$se
假设我有一个闭包: def increment = {value, step -> value + step } 现在我想遍历我的整数集合的每个项目,用 5 递增,并将新元素保存到一个新集合中:
使用逐页 View 时,我的 plone 集合文件夹未显示所有项目。基本上我有 9 页包含元素,但第 6 - 8 页显示的内容完全相同。因此,并非所有项目都会显示,即使项目总数对应于应该在集合中的元素
private Map> map ,其中 ProgramCourse 是我的项目中的域类,上面的 map 是我运行项目时域类 Program 的字段以下异常即将到来。 Use of @OneToMan
三者的主要区别是什么?现在,我想分别使用字符串/字符串创建一个键/值对。这三个似乎都有我可以使用的选项。 编辑:我只想创建一个简单的哈希表 - 没什么特别复杂的。 最佳答案 通用集合几乎完全取代了基础
我正在为 NodeJs 使用 mongodb 驱动程序,其中有 3 个方法: 1) db.collection.insert 2) 数据库.collection.insertOne 3) db.col
我有一个集合,我正在尝试使用 Distinct 方法删除重复项。 public static Collection imagePlaylist imagePlaylist = imagePlaylis
我是一名优秀的程序员,十分优秀!