Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-8808

[fiware-stackoverflow] Fiware Cygnus always wants to create a new MongoDB collection when it receives a notification

    Details

      Description

      Created question in FIWARE Q/A platform on 14-01-2017 at 22:01
      Please, ANSWER this question AT https://stackoverflow.com/questions/41655134/fiware-cygnus-always-wants-to-create-a-new-mongodb-collection-when-it-receives-a

      Question:
      Fiware Cygnus always wants to create a new MongoDB collection when it receives a notification

      Description:
      I want to save historical data into MongoDB using Fiware Cygnus. But whenever Cygnus receives a notification it wants to create a new collection instead of adding a document if the collection already exists. I get this error message from Cygnus:

      time=2017-01-14T20:58:11.785Z | lvl=WARN | corr=28eca6a8-da9c-11e6-841b-0242ac120009 | trans=9fa2d345-9aa1-4ff6-84df-75de5829a449 | srv=itg | subsrv=/building1 | comp=cygnus-ngsi | op=processNewBatches | msg=com.telefonica.iot.cygnus.sinks.NGSISink[590] : Command failed with error 48: 'a collection 'sth_itg.sth_/building1_TemperatureRoom1_room' already exists' on server iot-mongo:27017. The full response is

      { "ok" : 0.0, "errmsg" : "a collection 'sth_itg.sth_/building1_TemperatureRoom1_room' already exists", "code" : 48, "codeName" : "NamespaceExists" }

      This is my agent.conf file:

      cygnus-ngsi.sources = http-source
      cygnus-ngsi.sinks = mongo-sink
      cygnus-ngsi.channels = mongo-channel

      cygnus-ngsi.sources.http-source.type = org.apache.flume.source.http.HTTPSource
      cygnus-ngsi.sources.http-source.channels = mongo-channel
      cygnus-ngsi.sources.http-source.port = 5050
      cygnus-ngsi.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler
      cygnus-ngsi.sources.http-source.handler.notification_target = /notify
      cygnus-ngsi.sources.http-source.handler.default_service = default
      cygnus-ngsi.sources.http-source.handler.default_service_path = /
      cygnus-ngsi.sources.http-source.interceptors = ts gi
      cygnus-ngsi.sources.http-source.interceptors.ts.type = timestamp
      cygnus-ngsi.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.NGSIGroupingInterceptor$Builder
      cygnus-ngsi.sources.http-source.interceptors.gi.grouping_rules_conf_file = /opt/apache-flume/conf/grouping_rules.conf

      cygnus-ngsi.sinks.mongo-sink.type = com.telefonica.iot.cygnus.sinks.NGSIMongoSink
      cygnus-ngsi.sinks.mongo-sink.channel = mongo-channel
      #cygnus-ngsi.sinks.mongo-sink.enable_encoding = false
      #cygnus-ngsi.sinks.mongo-sink.enable_grouping = false
      #cygnus-ngsi.sinks.mongo-sink.enable_name_mappings = false
      #cygnus-ngsi.sinks.mongo-sink.enable_lowercase = false
      #cygnus-ngsi.sinks.mongo-sink.data_model = dm-by-entity
      #cygnus-ngsi.sinks.mongo-sink.attr_persistence = row
      cygnus-ngsi.sinks.mongo-sink.mongo_hosts = iot-mongo:27017
      cygnus-ngsi.sinks.mongo-sink.mongo_username =
      cygnus-ngsi.sinks.mongo-sink.mongo_password =
      #cygnus-ngsi.sinks.mongo-sink.db_prefix = sth_
      #cygnus-ngsi.sinks.mongo-sink.collection_prefix = sth_
      #cygnus-ngsi.sinks.mongo-sink.batch_size = 1
      #cygnus-ngsi.sinks.mongo-sink.batch_timeout = 30
      #cygnus-ngsi.sinks.mongo-sink.batch_ttl = 10
      #cygnus-ngsi.sinks.mongo-sink.data_expiration = 0
      #cygnus-ngsi.sinks.mongo-sink.collections_size = 0
      #cygnus-ngsi.sinks.mongo-sink.max_documents = 0
      #cygnus-ngsi.sinks.mongo-sink.ignore_white_spaces = true

      cygnus-ngsi.channels.mongo-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
      cygnus-ngsi.channels.mongo-channel.capacity = 1000
      cygnus-ngsi.channels.mongo-channel.transactionCapacity = 100

      Am I doing something wrong? Can someone help with this?

      Thank you in advance.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 58m 1 Backlog Manager 22/May/17 6:04 PM
        In Progress In Progress Answered Answered
        2h 59m 1 Backlog Manager 22/May/17 9:04 PM
        Answered Answered Closed Closed
        5d 23h 4m 1 Fernando Lopez 28/May/17 8:09 PM

          People

          • Assignee:
            frb Francisco Romero
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: