Skip to content

Commit

Permalink
Use Equinox 2-preview1 and Jet.CK.FSharp 1-preview1
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Mar 8, 2019
1 parent ac7f468 commit 11ad644
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions equinox-projector-cosmos/Consumer/Consumer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<ItemGroup>
<PackageReference Include="Argu" Version="5.2.0" />
<PackageReference Include="Destructurama.FSharp.NetCore" Version="1.0.14" />
<PackageReference Include="Equinox.Codec" Version="1.1.0-preview2" />
<PackageReference Include="Equinox.Projection.Codec" Version="1.1.0-preview2" />
<PackageReference Include="Equinox.Projection.Kafka" Version="1.1.0-preview2" />
<PackageReference Include="Equinox.Codec" Version="2.0.0-preview1" />
<PackageReference Include="Equinox.Projection.Codec" Version="2.0.0-preview1" />
<PackageReference Include="Jet.ConfluentKafka.FSharp" Version="1.0.0-preview1" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions equinox-projector-cosmos/Consumer/Program.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module ProjectorTemplate.Consumer.Program

open Equinox.Projection.Kafka
open Jet.ConfluentKafka.FSharp
open Serilog
open System
open System.Threading
Expand Down Expand Up @@ -29,7 +29,7 @@ module EventParser =
/// Addition of a collection of skus to the list
| Added of Added
interface TypeShape.UnionContract.IUnionContract
let codec = Equinox.UnionCodec.JsonUtf8.Create<Event>(settings)
let codec = Equinox.Codec.JsonNet.JsonUtf8.Create<Event>(settings)

// NB - these schemas reflect the actual storage formats and hence need to be versioned with care
module Favorites =
Expand All @@ -40,13 +40,13 @@ module EventParser =
| Favorited of Favorited
| Unfavorited of Unfavorited
interface TypeShape.UnionContract.IUnionContract
let codec = Equinox.UnionCodec.JsonUtf8.Create<Event>(settings)
let codec = Equinox.Codec.JsonNet.JsonUtf8.Create<Event>(settings)

let tryExtractCategory (x : RenderedEvent) =
x.s.Split([|'-'|], 2, StringSplitOptions.RemoveEmptyEntries)
|> Array.tryHead
let tryDecode (log : ILogger) (codec : Equinox.UnionCodec.IUnionEncoder<_,_>) (x : RenderedEvent) =
match codec.TryDecode { caseName = x.c; payload = x.d } with
let tryDecode (log : ILogger) (codec : Equinox.Codec.IUnionEncoder<_,_>) (x : RenderedEvent) =
match codec.TryDecode (Equinox.Codec.Core.EventData.Create(x.c, x.d)) with
| None ->
if log.IsEnabled Serilog.Events.LogEventLevel.Debug then
log.ForContext("event", System.Text.Encoding.UTF8.GetString(x.d), true)
Expand Down
2 changes: 1 addition & 1 deletion equinox-projector-cosmos/Projector/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open Equinox.Cosmos
open Equinox.Cosmos.Projection
//#if kafka
open Equinox.Projection.Codec
open Equinox.Projection.Kafka
open Jet.ConfluentKafka.FSharp
//#endif
open Equinox.Store
open Microsoft.Azure.Documents.ChangeFeedProcessor
Expand Down
6 changes: 3 additions & 3 deletions equinox-projector-cosmos/Projector/Projector.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<ItemGroup>
<PackageReference Include="Argu" Version="5.2.0" />
<PackageReference Include="Destructurama.FSharp.NetCore" Version="1.0.14" />
<PackageReference Include="Equinox.Cosmos.Projection" Version="1.1.0-preview2" />
<PackageReference Include="Equinox.Cosmos.Projection" Version="2.0.0-preview1" />
<!--#if (kafka)-->
<PackageReference Include="Equinox.Projection.Codec" Version="1.1.0-preview2" />
<PackageReference Include="Equinox.Projection.Kafka" Version="1.1.0-preview2" />
<PackageReference Include="Equinox.Projection.Codec" Version="2.0.0-preview1" />
<PackageReference Include="Jet.ConfluentKafka.FSharp" Version="1.0.0-preview1" />
<!--#endif-->
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
</ItemGroup>
Expand Down

0 comments on commit 11ad644

Please sign in to comment.