vmware-archive / chemtrails Goto Github PK
View Code? Open in Web Editor NEWChemtrails is a gem used to integrate a Rails app with a Spring Cloud Config server.
License: MIT License
Chemtrails is a gem used to integrate a Rails app with a Spring Cloud Config server.
License: MIT License
Looks like the support of Rails 5.0 was reverted to 4.0, any reasons?
When can it be available for 5.x support?
Hi,
first thanks for this gem, as it had helped us to integrate our rails app into spring cloud config. The thing is that we need to reload ENV vars from SCC while the app is still running.
We are trying to modify the chemtrails railtie to mimic the Spring Cloud Bus (that uses RabbitMQ) to get events of "Configuration changed" with the next snippet
config.before_configuration do
startup(Rails.application.class.parent.to_s.downcase, Rails.env, ENV) unless Rails.env.test?
rabbit_host = ENV['rabbit_host']
rabbit_port = ENV['rabbit_port'] ||
rabbit_username = ENV['rabbit_username']
rabbit_password = ENV['rabbit_password']
rabbit_vhost = ENV['rabbit_vhost'] || '#'
unless Rails.env.test? || rabbit_host.nil?
conn = Bunny.new(
:host => rabbit_host,
:port => rabbit_port,
:user => rabbit_username,
:password => rabbit_password
)
conn.start
ch = conn.create_channel
q = ch.queue("springCloudBus.anonymous." + Rails.application.class.parent.to_s.downcase + Time.now.to_i.to_s, :auto_delete => true, :exclusive => true)
q.bind("springCloudBus", :routing_key => "#")
q.subscribe do |delivery_info, metadata, payload|
obj = JSON.parse(payload)
# Only reload the application on events of refresh configurattion
if obj['type'] == "RefreshRemoteApplicationEvent"
startup(Rails.application.class.parent.to_s.downcase, Rails.env, ENV)
puts ENV
end
end
end
end
And it fetches an populates the ENV with the new configuration but for any reason when we visit any of the http endpoints to check the environment
# frozen_string_literal: true
class EnvController < ApplicationController
before_action :authenticate_user!
def index
render json: ENV
end
end
The value is the initial value when the application started.
Do you have any hint about what can we do to get this working? Is it possible?
When providing chemtrails with an extra long (read: actually secure) username and password, the gem will fail trying to receive information from the config server.
It gives some cryptic Syntax error: Unterminated quote string
error. Upon further investigation, we discovered that it is most likely the gem Excon
being used by chemtrails for http interaction with the config server. Using Excon manually with the credentials gets back a 400 Bad Request
. Using a username and password with fewer characters fixes this issue.
I didn't check what the length Excon
is actually okay with, I just chopped off some characters until it worked. ¯_(ツ)_/¯
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.