You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to publish and subscribe message but there is issues from newtonsoft
My code:
privatestaticIBusClient_client;staticvoidMain(string[]args){_client=BusClientFactory.CreateDefault();_client.SubscribeAsync<Sender>(ServeValuesAsync, x =>x.WithExchange(x =>x.WithName("rabit").WithType(RawRabbit.Configuration.Exchange.ExchangeType.Topic)));}privatestaticTaskServeValuesAsync(Sendermessage,MessageContextcontext){return_client.PublishAsync(newSender{Message="Test"});}//PublisherpublicstaticvoidAddRabbitMq(thisIServiceCollectionservices,IConfigurationSectionsection){// RabbitMQ Configurationvaroptions=newRawRabbitConfiguration();section.Bind(options);varclient=BusClientFactory.CreateDefault();services.AddSingleton<IBusClient>(_ =>client);}[HttpGet]publicasyncTaskGet(){awaitbusClient.PublishAsync(newSender{Message="Test"},Guid.NewGuid(), x =>x.WithExchange(x =>x.WithName("rabit").WithType(RawRabbit.Configuration.Exchange.ExchangeType.Topic)));}
I used .NET CORE 3.1 api + console app
How Can i solve it?
Error Message:
[17:41:09] [$4] [ERROR] [DefaultStrategy]: Error thrown in Subscriber: , Exception:
Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'Rabit20.Sender, Rabit20'. Path '$type', line 1, position 44.
---> Newtonsoft.Json.JsonSerializationException: Could not load assembly 'Rabit20'.
at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey2 typeNameKey) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Newtonsoft.Json.Utilities.ThreadSafeStore2.Get(TKey key)
at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeByName(StructMultiKey2 typeNameKey) at Newtonsoft.Json.Serialization.DefaultSerializationBinder.BindToType(String assemblyName, String typeName) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName) --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataProperties(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at RawRabbit.Serialization.JsonMessageSerializer.Deserialize(Byte[] bytes, Type messageType) at RawRabbit.Serialization.JsonMessageSerializer.Deserialize[T](Byte[] bytes) at RawRabbit.Operations.Subscriber1.<>c__DisplayClass11_21.<SubscribeAsync>b__2() at RawRabbit.ErrorHandling.DefaultStrategy.ExecuteAsync(Func1 messageHandler, Func2 errorHandler) [17:41:09] [$5] [ERROR] [DefaultStrategy]: Error thrown in Subscriber: , Exception: Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'Rabit20.Sender, Rabit20'. Path '$type', line 1, position 44. ---> Newtonsoft.Json.JsonSerializationException: Could not load assembly 'Rabit20'. at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey2 typeNameKey)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
[17:41:09] [$4] [WARN] [DefaultStrategy]: Unable to publish message 'a333fc2f-5e3a-49ef-ae04-04a71ecf1fe1' to default error exchange.
The text was updated successfully, but these errors were encountered:
Maybe it's a problem with .NET Core 3.1? I have different error like Method not found: 'System.String RabbitMQ.Client.DefaultBasicConsumer.get_ConsumerTag() while trying to Subscribe to the queue and another error while trying to publish message:
Attempt by method 'RawRabbit.Common.BasicPropertiesProvider.GetProperties(System.Action`1<RabbitMQ.Client.IBasicProperties>)' to access method 'RabbitMQ.Client.Framing.BasicProperties..ctor()' failed.
I tried to publish and subscribe message but there is issues from newtonsoft
My code:
I used .NET CORE 3.1 api + console app
How Can i solve it?
Error Message:
The text was updated successfully, but these errors were encountered: