0

I use akka.net in a cluster schema. (n) processing nodes, with currently 1 lighthouse.

One of the package that navigate throught network expose langage information.

    /// <summary>
/// Define scored a suite of token info
/// </summary>
/// <seealso cref="Hammer.Immutable.ImmutableObject" />
[DataContract]
public sealed class TokenSuite : ImmutableObject, IIdItem
{
    #region Ctor

    /// <summary>
    /// Initializes a new instance of the <see cref="TokenSuite"/> class.
    /// </summary>
    public TokenSuite(Guid id, string langCode)
        : base(id, langCode)
    {
        this.Id = id;
        this.LangCode = langCode;

        if (!string.IsNullOrEmpty(langCode))
            LangInfo = CultureInfo.GetCultureInfoByIetfLanguageTag(langCode);
    }

    #endregion

    #region Properties

    /// <summary>
    /// Gets the identifier.
    /// </summary>
    [DataMember]
    public Guid Id { get; }

    /// <summary>
    /// Gets the main language code.
    /// </summary>
    [DataMember]
    public string LangCode { get; }

    /// <summary>
    /// Gets the lang information.
    /// </summary>
    [IgnoreDataMember]
    public CultureInfo LangInfo { get; }


    #endregion

In local no problem but when it pass through the network (serialized) i got this issue on the lighthouse : LightHouse Issue

Reading the error it seems coming from the CultureInfo Object but it is flag to be ignored in the serializations.

I use Akka version 1.3.5, Hyperion 0.9.8, Akka.Serialization.Hyperion 1.3.2-beta54.

I try to serialize locally and it works :

var serializer = Context.System.Serialization.FindSerializerForType(typeof(TokenSuite));
var data = serializer.ToBinary(result);
var rtoObjectBack = serializer.FromBinary<TokenSuite>(data);

Any idea ?

Mickael Thumerel
  • 516
  • 4
  • 14

1 Answers1

1

Hyperion does not make any use of data contract attributes. This also means that [IgnoreDataMember] won't be taken into account.

Probably it fails when trying to deserialize a CultureInfo object, you've provided. You can always try to convert that to string, and resolve after deserialization.

Bartosz Sypytkowski
  • 7,463
  • 19
  • 36