{"action":"created","issue":{"url":"https://api.github.com/repos/Data-to-Insight-Center/komadu/issues/5","labels_url":"https://api.github.com/repos/Data-to-Insight-Center/komadu/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Data-to-Insight-Center/komadu/issues/5/comments","events_url":"https://api.github.com/repos/Data-to-Insight-Center/komadu/issues/5/events","html_url":"https://github.com/Data-to-Insight-Center/komadu/issues/5","id":98797818,"number":5,"title":"Running Komadu on Mesos cluster: Web service or Standalone server?","user":{"login":"sid-thakur","id":5922613,"avatar_url":"https://avatars.githubusercontent.com/u/5922613?v=3","gravatar_id":"","url":"https://api.github.com/users/sid-thakur","html_url":"https://github.com/sid-thakur","followers_url":"https://api.github.com/users/sid-thakur/followers","following_url":"https://api.github.com/users/sid-thakur/following{/other_user}","gists_url":"https://api.github.com/users/sid-thakur/gists{/gist_id}","starred_url":"https://api.github.com/users/sid-thakur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sid-thakur/subscriptions","organizations_url":"https://api.github.com/users/sid-thakur/orgs","repos_url":"https://api.github.com/users/sid-thakur/repos","events_url":"https://api.github.com/users/sid-thakur/events{/privacy}","received_events_url":"https://api.github.com/users/sid-thakur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":53,"created_at":"2015-08-03T17:24:22Z","updated_at":"2015-09-30T13:54:40Z","closed_at":null,"body":"Hi @isurues \r\nWe have an Apache Mesos cluster within which we'd like to deploy Komadu. Ideally, we'd like komadu to run in its own VM on the cluster and be able to receive event-style notifications from a web app and other process running on another, production-level, VM. Essentially, we'd like to be able to send prov notification events from other VMs to komdu (running in its own VM).\r\n\r\nWhat I'd like to know is which of the two methods of running Komadu, web service or standalone server, would be suitable for our scenario. Please also clarify what accommodations, if any, would we need to make to enable Komadu to function within this multi-VM envrionment.\r\n\r\nThanks,\r\nSid\r\n---"},"comment":{"url":"https://api.github.com/repos/Data-to-Insight-Center/komadu/issues/comments/144410838","html_url":"https://github.com/Data-to-Insight-Center/komadu/issues/5#issuecomment-144410838","issue_url":"https://api.github.com/repos/Data-to-Insight-Center/komadu/issues/5","id":144410838,"user":{"login":"sid-thakur","id":5922613,"avatar_url":"https://avatars.githubusercontent.com/u/5922613?v=3","gravatar_id":"","url":"https://api.github.com/users/sid-thakur","html_url":"https://github.com/sid-thakur","followers_url":"https://api.github.com/users/sid-thakur/followers","following_url":"https://api.github.com/users/sid-thakur/following{/other_user}","gists_url":"https://api.github.com/users/sid-thakur/gists{/gist_id}","starred_url":"https://api.github.com/users/sid-thakur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sid-thakur/subscriptions","organizations_url":"https://api.github.com/users/sid-thakur/orgs","repos_url":"https://api.github.com/users/sid-thakur/repos","events_url":"https://api.github.com/users/sid-thakur/events{/privacy}","received_events_url":"https://api.github.com/users/sid-thakur/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T13:54:40Z","updated_at":"2015-09-30T13:54:40Z","body":"@gabrielzhouquan \r\nOkay, this time there is no error in komadu log. But client does not receive response. I think something to do with my receiver. Thanks. \r\n\r\nKomadu log output:\r\n```\r\n30 Sep 2015 09:46:33,899 [main] INFO  edu.indiana.d2i.komadu.messaging.MessageDaemons  -Starting Notification Deamon [0]  for receiving notifications from C\r\nlient.\r\n30 Sep 2015 09:46:33,901 [main] INFO  edu.indiana.d2i.komadu.messaging.MessageDaemons  -Notification Deamon [0] Started.\r\n30 Sep 2015 09:46:33,901 [main] INFO  edu.indiana.d2i.komadu.messaging.MessageDaemons  -Starting Query Deamon [0] for receiving queries from Client.\r\n30 Sep 2015 09:46:33,901 [Thread-0] INFO  edu.indiana.d2i.komadu.messaging.NotificationReceiverRunnable  -[Komadu server: Listening to Messaging System]\r\n30 Sep 2015 09:46:33,901 [main] INFO  edu.indiana.d2i.komadu.messaging.MessageDaemons  -Query Deamon [0] Started.\r\n30 Sep 2015 09:46:33,902 [Thread-1] INFO  edu.indiana.d2i.komadu.messaging.QueryReceiverRunnable  -[Komadu server: Listening Queries from Messaging System]\r\n30 Sep 2015 09:46:40,613 [Thread-1] INFO  edu.indiana.d2i.komadu.messaging.QueryReceiverRunnable  -[Komadu server: One Query received]\r\n3d429c86-89da-dd3e-2ced-fe7d24e335f8#<quer:findEntityRequest xmlns:quer=\"http://komadu.d2i.indiana.edu/query\">\r\n  <quer:fileName>data1.txt_58</quer:fileName>\r\n  <quer:fileOwnerID>jerry112</quer:fileOwnerID>\r\n  <quer:fileSize>500</quer:fileSize>\r\n</quer:findEntityRequest>\r\n\r\n30 Sep 2015 09:46:40,613 [Thread-1] INFO  edu.indiana.d2i.komadu.messaging.QueryReceiverRunnable  -[Karma server: Query] <quer:findEntityRequest xmlns:quer=\r\n\"http://komadu.d2i.indiana.edu/query\">\r\n  <quer:fileName>data1.txt_58</quer:fileName>\r\n  <quer:fileOwnerID>jerry112</quer:fileOwnerID>\r\n  <quer:fileSize>500</quer:fileSize>\r\n</quer:findEntityRequest>\r\n30 Sep 2015 09:46:40,613 [Thread-1] INFO  edu.indiana.d2i.komadu.messaging.QueryReceiverRunnable  -[Karma server: Query Response Routing Key] 3d429c86-89da-\r\ndd3e-2ced-fe7d24e335f8\r\n30 Sep 2015 09:46:41,158 [Thread-1] INFO  edu.indiana.d2i.komadu.messaging.QueryReceiverRunnable  -[Komadu server: Send Query Response to Client]\r\n30 Sep 2015 09:46:41,171 [Thread-1] INFO  edu.indiana.d2i.komadu.messaging.QueryReceiverRunnable  -[Komadu server: Listening Queries from Messaging System]\r\n```\r\n\r\nReceiver code. The function `ch.consume (q, function(msg) {..}` with msg doesn't get called.\r\n```\r\nexports.prov_receive = function () {\r\n\r\n    console.log (\"[PROV_RECEIVE] Inside receiver code\");\r\n\r\n    var queueName = 'KomaduQueueQueryResponse';\r\n\r\n    // error handler function\r\n    function bail(err, conn) {\r\n\tlogger.debug (err);\r\n\tif (conn) {\r\n\t    conn.close(function() {\r\n\t\t// DO NOTHING\r\n\t    });\r\n\t}\r\n    }\r\n\r\n    function on_connect(err, conn) {\r\n\t// check if connection failed\r\n\tif (err !== null) {\r\n\t    return bail(err);\r\n\t}\r\n\r\n\tprocess.once('SIGINT', function() {\r\n\t    conn.close();\r\n\t});\r\n\r\n\tvar q = queueName;\r\n\r\n\tfunction on_channel_open(err, ch) {\r\n\r\n\t    ch.assertQueue(q, {}, function(err, ok) {\r\n\t\tconsole.log ('[PROV_RECEIVE] channel ok? ' + JSON.stringify(ok));\r\n\t\tif (err !== null) {\r\n\t\t    return bail(err, conn);\r\n\t\t}\r\n\r\n\t\t// message callback\r\n\t\tch.consume (q, function(msg) {\r\n\r\n\t\t    console.log (\" [x] Received '%s'\", msg.content.toString());\r\n\t\t    logger.debug ('[PROV_RECEIVE] Provenance notification received from Komadu server');\r\n\t\t    ch.close ();\r\n\r\n\t\t}, {noAck: false}, function(_consumeOk) { // consume callback\r\n\t\t    console.log ('_consumeOk: ' + JSON.stringify (_consumeOk));\r\n\t\t    console.log (' [*] Waiting for messages. To exit press CTRL+C');\r\n\t\t});\r\n\t    });\r\n\t}\r\n\tconsole.log ('[PROV_RECEIVE] queue: ' + queueName);\r\n\r\n\tconn.createChannel(on_channel_open);\r\n    }\r\n\r\n    amqp.connect('amqp://kuser:resuk@127.0.0.1:5672', on_connect);\r\n};\r\n```\r\n\r\nCalling emit and receive in following order:\r\n```\r\n\texports.prov_emit ('', 'KomaduQueueQueryRequest');\r\n\texports.prov_receive ();\r\n```\r\n\r\n\r\nConsole output on my server: \r\n```\r\n[PROV_SEND] Inside notification send code\r\n[PROV_SEND] UUID: 3d429c86-89da-dd3e-2ced-fe7d24e335f8\r\n\r\n[PROV_RECEIVE] Inside receiver code\r\n\r\n[PROV_SEND] connecting to queue: KomaduQueueQueryRequest\r\n\r\n[PROV_RECEIVE] queue: KomaduQueueQueryResponse\r\n[PROV_SEND] Provenance notification sent to Komadu server\r\n[PROV_RECEIVE] channel ok? {\"queue\":\"KomaduQueueQueryResponse\",\"messageCount\":0,\"consumerCount\":0}\r\n_consumeOk: null\r\n [*] Waiting for messages. To exit press CTRL+C\r\n[PROV_SEND] Closing connection...\r\n```\r\n"}}