Comments (8)
In our case (our case = no rails but activesupport/railties) script fails on Rails.logger.extend so kind of ugly hot-fix would be changing
begin
require "rails"
rescue LoadError
# Not a Rails application.
end
to
class OnlyActiveSupportDetected < LoadError; end
begin
require "rails"
raise OnlyActiveSupportDetected if Rails.logger.blank?
rescue LoadError, OnlyActiveSupportDetected
# Not a Rails application.
end
but it's ugly and I don't like it and it can still produce False-Positives (less than before of course, so that's good) but there could be more false-negatives (i.e. Rails apps that have no .logger assigned? Is it possible? I don't know).
from racecar.
Our temporary fix which apparently does not break anything
#kafka_setup.rb
Racecar::RailsConfigFileLoader.class_eval do
def self.load!
$stderr.puts "=> Skipping rails detection as monkeypatch in kafka_setup.rb..."
end
end
and include this file in bundle exec racecar --require kafka_setup.rb
from racecar.
Can you figure out a better way of detecting Rails?
from racecar.
Plus one for a fix on this - using racecar with ActiveRecord and no rails
from racecar.
How about a --no-rails
flag that disables Rails booting?
from racecar.
Lets share some friendly knowledge and advise :) why not like that? https://github.com/karafka/karafka/blob/master/lib/karafka/cli/install.rb#L31
from racecar.
If it works! ❤️
Anyone up for doing a PR?
from racecar.
Works really well for "us". Also allows to determine that you have rails in the stack (I don't expect anyone sane to include it and not use it at all) prior to being loaded.
from racecar.
Related Issues (20)
- Unable to configure producer partitioner_name HOT 2
- [question] Multi service Datadog dashboard setup HOT 1
- Consumer client ids defaulting to consumer-null-NNNN
- Consumer reset not needed on a :not_coordinator according to librdkafka HOT 1
- Allow setting King Konf's ignore_unknown_variables HOT 3
- How to do a quick health check HOT 2
- Define active_support dependencies in production.
- IAM access control HOT 1
- Configure producer using environment variables HOT 2
- Config not loaded automatically for a producer in Rails. HOT 1
- Potential bug in pause/resume logic HOT 1
- Undefined method `produce_sync' for Racecar:Module HOT 1
- `max_bytes_per_partition` config mapping within librdkafka
- Running racecar with --daemonize option triggers NoMethodError: undefined method `exists?' for File:Class HOT 1
- Add support for AWS_MSK_IAM SASL mechanism to racecar
- Add support for New Relic integration
- 2.9.0: config.rd incorrectly caches group_id when using default
- ActiveSupport::Logger.broadcast dropped in Rails 7.1
- rdkafka 0.14.0.rc1 update HOT 1
- `process` method strict arity check causes incompatibility with NewRelic Elastic APM gem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from racecar.