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

[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 http://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
        1d 12h 1 Backlog Manager 16/Jan/17 12:05 PM
        In Progress In Progress Answered Answered
        2h 59m 1 Backlog Manager 16/Jan/17 3:05 PM
        Answered Answered Closed Closed
        7d 19h 15m 1 Francisco Romero 24/Jan/17 10:20 AM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Unknown [ 10910 ] Cosmos [ 10872 ]
        Description
        Created question in FIWARE Q/A platform on 14-01-2017 at 22:01
        {color: red}Please, ANSWER this question AT{color} http://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.
        Created question in FIWARE Q/A platform on 14-01-2017 at 22:01
        {color: red}Please, ANSWER this question AT{color} http://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.
        HD-Chapter Unknown [ 10845 ] Data [ 10838 ]
        frb Francisco Romero made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-01-16 15:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-01-16 15:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-01-16 12:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-01-16 12:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        Assignee Francisco Romero [ frb ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-01-15 00:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-01-15 00:05|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager created issue -

          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: