Skip to content

Commit

Permalink
Target released packages
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Jan 31, 2019
1 parent 79cf922 commit 2cd3bd9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
13 changes: 5 additions & 8 deletions equinox-projector-cosmos/Consumer/Consumer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
<ItemGroup>
<PackageReference Include="Argu" Version="5.2.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="TypeShape" Version="6.0.1" />
<!--<PackageReference Include="TypeShape" Version="6.0.1" />-->
<PackageReference Include="Equinox.Codec" Version="1.1.0-beta3" />
<PackageReference Include="Equinox.Projection.Codec" Version="1.1.0-beta3" />
<PackageReference Include="Equinox.Projection.Kafka" Version="1.1.0-beta3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\equinox\src\Equinox.Codec\Equinox.Codec.fsproj" />
<ProjectReference Include="..\..\..\equinox\src\Equinox.Projection.Codec\Equinox.Projection.Codec.fsproj" />
<ProjectReference Include="..\..\..\equinox\src\Equinox.Projection.Kafka\Equinox.Projection.Kafka.fsproj" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions equinox-projector-cosmos/Consumer/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module EventParser =
interface TypeShape.UnionContract.IUnionContract
let codec = Equinox.UnionCodec.JsonUtf8.Create<Event>(settings)

let tryExtractCategory (x : RenderedEvent =
let tryExtractCategory (x : RenderedEvent) =
x.s.Split([|'-'|],2,StringSplitOptions.RemoveEmptyEntries)
|> Array.tryHead
let tryDecode (log : ILogger) (codec : Equinox.UnionCodec.IUnionEncoder<_,_>) (x : RenderedEvent) =
Expand Down Expand Up @@ -158,7 +158,7 @@ let main argv =
Logging.initialize args.Verbose
let cfg = KafkaConsumerConfig.Create("ProjectorTemplate", args.Broker, [args.Topic], args.Group)

let c = Consumer.start cfg args.Parallelism
use c = Consumer.start cfg args.Parallelism
c.AwaitConsumer() |> Async.RunSynchronously
0
with
Expand Down
11 changes: 4 additions & 7 deletions equinox-projector-cosmos/Projector/Projector.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
<ItemGroup>
<PackageReference Include="Argu" Version="5.2.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Equinox.Cosmos.Projection" Version="1.1.0-beta3" />
<PackageReference Include="Equinox.Projection.Codec" Version="1.1.0-beta3" />
<PackageReference Include="Equinox.Projection.Kafka" Version="1.1.0-beta3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\equinox\src\Equinox.Cosmos.Projection\Equinox.Cosmos.Projection.fsproj" />
<ProjectReference Include="..\..\..\equinox\src\Equinox.Projection.Codec\Equinox.Projection.Codec.fsproj" />
<ProjectReference Include="..\..\..\equinox\src\Equinox.Projection.Kafka\Equinox.Projection.Kafka.fsproj" />
</ItemGroup>

</Project>
</Project>
29 changes: 17 additions & 12 deletions equinox-projector-cosmos/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Equinox Projector Template
# Equinox Projector/Consumer Template

This project was generated using:

Expand All @@ -13,12 +13,15 @@ This project was generated using:
```

To provide sample data to project:

0. establish connection strings etc. per https://github.com/jet/equinox README

```powershell
$env:EQUINOX_COSMOS_CONNECTION="AccountEndpoint=https://....;AccountKey=....=;"
$env:EQUINOX_COSMOS_DATABASE="equinox-test"
$env:EQUINOX_COSMOS_COLLECTION="equinox-test"
$env:EQUINOX_COSMOS_CONNECTION="AccountEndpoint=https://....;AccountKey=....=;" # or use -s
$env:EQUINOX_COSMOS_DATABASE="equinox-test" # or use -d
$env:EQUINOX_COSMOS_COLLECTION="equinox-test" # or use - c

$env:EQUINOX_KAFKA_BROKER="instance.kafka.mysite.com:9092" # or use -b
```

1. Use the eqx tool to initialize and then run some transactions in a CosmosDb collection
Expand All @@ -38,25 +41,27 @@ To provide sample data to project:
2. To run the Projector:

```powershell

# (either add environment variables as per step 0 or use -s/-d/-c to specify them)
# `-b 1000` sets the max batch size to 1000
# `-n epoch0` defines the Projector instance id - each id has separated state in the aux collection
dotnet run -p Projector -- -n epoch0 -b 1000

# `epoch0` defines the Projector instance id - each id has separated state in the aux collection
# `-m 1000` sets the max batch size to 1000
dotnet run -p Projector -- epoch0 -m 1000 cosmos
# NB (assuming you've scaled up enough to have >1 range, you can run a second instance in a second console with the same arguments)
```
//#else

2. To run the Projector:

```powershell
$env:EQUINOX_COSMOS_CONNECTION="AccountEndpoint=https://....;AccountKey=....=;"
$env:EQUINOX_COSMOS_DATABASE="equinox-test"
$env:EQUINOX_COSMOS_COLLECTION="equinox-test"
$env:EQUINOX_KAFKA_BROKER="instance.kafka.mysite.com:9092" # or use -b

# (either add environment variables as per step 0 or use -s/-d/-c to specify them)
# `-m 1000` sets the max batch size to 1000

# `epoch0` defines the Projector instance id - each id has separated state in the aux collection
# `-t topic0` identifies the Kafka topic which the Projector is to write to
# `-m 1000` sets the max batch size to 1000
# `-t topic0` identifies the Kafka topic to which the Projector should write
# cosmos specifies the source (if you have specified 3x EQUINOX_COSMOS_* environment vars, no arguments are needed)
dotnet run -p Projector -- epoch0 -m 1000 -t topic0 cosmos
# NB (assuming you've scaled up enough to have >1 range, you can run a second instance in a second console with the same arguments)
```
Expand Down

0 comments on commit 2cd3bd9

Please sign in to comment.