EventStore仅在有效负载列中显示十六进制字符串 [英] EventStore only showing hexadecimal string in Payload column

查看:97
本文介绍了EventStore仅在有效负载列中显示十六进制字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,我应该在SQL数据库Commits表的Payload列中显示JSON,但是我有一个很长的十六进制字符串.

As far as I can tell I should have JSON showing in Payload column in my SQL database Commits table, however I have a long hexadecimal string.

我的接线代码根据示例进行以下修改:

My wireup code is as per the sample with the following edits:

private static IStoreEvents WireupEventStore()
{
        return Wireup.Init()
        .LogToOutputWindow()
        .UsingInMemoryPersistence()
        .UsingSqlPersistence("EventStore") // Connection string is in app.config
            .WithDialect(new MsSqlDialect())
            .EnlistInAmbientTransaction() // two-phase commit
            .InitializeStorageEngine()
            .UsingJsonSerialization()
        .HookIntoPipelineUsing(new[] { new AuthorizationPipelineHook() })
        .UsingSynchronousDispatchScheduler()
            .DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
        .Build();
}

有什么主意如何获取JSON并使调试更容易吗?

Any idea how to get JSON and make debugging easier?

推荐答案

只需创建以下视图:

CREATE VIEW [dbo].[DeserializedCommits]
    AS 
    SELECT 
         [StreamId]
        ,[StreamRevision]
        ,[Items]
        ,[CommitId]
        ,[CommitSequence]
        ,[CommitStamp]
        ,[Dispatched]
        ,CAST([Headers] AS VARCHAR(MAX)) AS [Headers]
        ,CAST([Payload] AS VARCHAR(MAX)) AS [Payload]
    FROM [dbo].[Commits]

然后您可以使用Payload列上的LIKE在事件存储中查询特定事件.

You can than query your event store for specific events using LIKE on Payload column.

这篇关于EventStore仅在有效负载列中显示十六进制字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆