Skip to content

Commit

Permalink
Add osiris.app.src file (#158)
Browse files Browse the repository at this point in the history
* Add osiris.app.src file

Fixes compilation with `rebar3`

* specify default env in app.src

* improve app.src

* app.src

---------

Co-authored-by: Karl Nilsson <kjnilsson@gmail.com>
  • Loading branch information
lukebakken and kjnilsson committed Apr 30, 2024
1 parent 901b71d commit 2994958
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
PROJECT = osiris
PROJECT_DESCRIPTION = Foundation of the log-based streaming subsystem for RabbitMQ
PROJECT_VERSION = 1.8.1
# PROJECT_DESCRIPTION = Foundation of the log-based streaming subsystem for RabbitMQ
# PROJECT_VERSION = 1.8.1

define PROJECT_ENV
[
{data_dir, "/tmp/osiris"},
{port_range, {6000, 6500}},
{max_segment_size_chunks, 256000},
{replication_transport, tcp},
{replica_forced_gc_default_interval, 4999}
]
endef
# define PROJECT_ENV
# [
# {data_dir, "/tmp/osiris"},
# {port_range, {6000, 6500}},
# {max_segment_size_chunks, 256000},
# {replication_transport, tcp},
# {replica_forced_gc_default_interval, 4999}
# ]
# endef
#
# This project uses an app.src file

LOCAL_DEPS = sasl crypto
dep_gen_batch_server = hex 0.8.8
Expand Down
11 changes: 11 additions & 0 deletions src/osiris.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{application,osiris,
[{description,"Foundation of the log-based streaming subsystem for RabbitMQ"},
{vsn,"1.8.1"},
{licenses,["Apache-2.0","MPL-2.0"]},
{links,[{"github","https://github.com/rabbitmq/osiris"}]},
{modules,[]},
{registered,[ra_sup]},
{applications,[kernel,stdlib,sasl,crypto,gen_batch_server,
seshat]},
{mod,{osiris_app,[]}},
{env,[{data_dir, "/tmp/osiris"}]}]}.
5 changes: 4 additions & 1 deletion src/osiris_replica.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

-include("osiris.hrl").

-define(DEFAULT_PORT_RANGE, {6000, 6500}).

%% osiris replica, starts TCP listener ("server side" of the link),
%% spawns remote reader, TCP listener replicates and
%% confirms latest offset back to primary
Expand Down Expand Up @@ -163,7 +165,8 @@ handle_continue(#{name := Name0,
{badrpc, Reason} ->
{stop, {badrpc, Reason}, undefined};
{ok, {LeaderRange, LeaderEpochOffs}} ->
{ok, {Min, Max}} = application:get_env(port_range),
{Min, Max} = application:get_env(osiris, port_range,
?DEFAULT_PORT_RANGE),
Transport = application:get_env(osiris, replication_transport, tcp),
Self = self(),
CntName = {?MODULE, ExtRef},
Expand Down

0 comments on commit 2994958

Please sign in to comment.