-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manifest consolidation for L2 PCF #294
base: develop
Are you sure you want to change the base?
Conversation
- deploys efc and efc-web - includes notes and json to create db
Note: We still have an open ticket to make the mqtt public, currently it is a private ip. Additions: - manifest now includes step to create the service and binding to the efc app - created a Map for keys and values found if VCAP_SERVCIES mqtt exists - Added connection options to pass to the connect function to include username and password to the connection.
If using VCAP services connection, it will parse the ssl value and set the connection to ssl. For other applications the MQTT_BROKER_URL env variable will be used.
@mrcnc scheme is now pulled from the vcap. |
"Map of keys and values from VCAP_SERVICES mqtt environment variable" | ||
(or (some-> (System/getenv "VCAP_SERVICES") | ||
(json/read-str :key-fn clojure.core/keyword) :p-rabbitmq first :credentials :protocols :mqtt) | ||
{:username :username |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if there isn't a VCAP_SERVICES environment variable, we'll want to set default mqtt options. Therefore the values in this map should represent that, ex
{:host "localhost" :port 1883 :ssl false}
@@ -61,7 +82,7 @@ | |||
(log/debugf "Connecting MQTT Client to %s" url) | |||
(try | |||
(do | |||
(reset! conn (mh/connect url client-id)) | |||
(reset! conn (mh/connect url client-id mqtt-connect-ops)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we should allow connections to brokers that don't require any credentials. So refactor this to set credentials if they exist, otherwise connect with (mh/connect url client-id)
{:username (or (System/getenv "MQTT_USERNAME") (:username vcap_mqtt)) | ||
:password (or (System/getenv "MQTT_PASSWORD") (:password vcap_mqtt))}) | ||
|
||
(def vcap_tcp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this to mqtt-url
?
|
||
(def vcap_tcp | ||
"When vcap_mqtt exists it returns a formated tcp connection" | ||
(when (some? vcap_mqtt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like are trying to define the url to use so this should always return a string....so I would remove this line b/c vcap_mqtt should always return the defaults that you can use to build the mqtt url.
Status
IN DEVELOPMENT
JIRA Ticket
CAPI-241
Description
Todos
Note: We still have an open ticket to make the mqtt public, currently it is a private ip.
Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.
see manifest.yml