20
Views
2
Comments
Solved
[RabbitMQ Client] RabbitMQ Extension - OS 11.38.0 - Rabbitmq.client.5.1.0 to Rabbitmq.client.7.1.2
rabbitmq-client
Service icon
Forge asset by André Vieira
Service Studio Version
11.55.16 (Build 64072)
Platform Version
11.38.0 (Build 45971)

Hi,

We have written an extension to publish to a RabbitMQ server (not the one used by Outsystems for caching). Prior to Outsystem Platform 11.38.0, the extension was working. After upgrading to Outsystem Platform 11.38.0, the extension fails and the error encountered was:

"Could not load type 'RabbitMQ.Client.IModel' from assembly 'RabbitMQ.Client, Version=7.0.0, Culture=neutral, PublicKeyToken=<some token string>'

It's most likely due to the upgrade of RabbitMQ.Client from v5 to v7. 

The users of the forge asset "RabbitMQ Client" will be facing the same issues and someone has already asked for help there too but didn't get any resolution.


Are there anyone who has encountered the same issue and has resolved it?

Or ideas on how to resolve it?


Thanks and regards,

C3D

2024-11-04 15-59-50
João Inácio
Solution

Hi

The error suggests your application is looking for IModel in RabbitMQ.Client version 7.0.0, but this type might have been moved or renamed. In RabbitMQ.Client v6.0+, IModel was deprecated and replaced with IChannel.

OutSystems does replace certain DLLs with platform versions, for example Newtonsoft.Json is one of the most common cases where this happens. 

OutSystems typically replaces:

    ∙    Newtonsoft.Json (Json.NET)

    ∙    System. assemblies* that are part of .NET Framework

    ∙    Other common libraries the platform uses internally


For your RabbitMQ issue specifically, the problem is likely that RabbitMQ.Client expects a certain version of dependencies, but OutSystems is replacing them with incompatible versions. 



Update this extension to use RabbitMQ.Client 7.1.2 NuGet package, and also refactor the code to use the new API (replace IModel with IChannel)

UserImage.jpg
c3d

Hi João Inácio,

Thanks for the reply.

We do have to rewrite the code to use the new API.


For others facing similar issues, you might want to take note of the following:

1) RabbitMQ.Client 7.1.2 uses the .NET Standard 2.0 framework which means we need .NET framework 4.8 and up (which fully supports .NET Standard 2.0) installed with the Outsystems Platform Server

2) When compiling the extension, we have to target .NET framework 4.8

3) RabbitMQ.Client 7.1.2 uses Task Asynchronous Programming model so we have to handle that in the codes

4) The RabbitMQ guide provides good examples: https://www.rabbitmq.com/client-libraries/dotnet-api-guide

Regards,

C3D

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.