Search Results for

    Show / Hide Table of Contents

    Interface IMessenger

    An interface for connecting to a message service, subscribing to a topic, and sending messages to it. Used by the system in order for lemonedge to pass messages for synchronisation across services.

    By default the MessageType config setting only allows Azure message bus configuration

    Implementing this interface, and IMessageListener, and marking them with the MessageManagerAttribute will expand the options from the config settings to enable using your custom message service.

    You can then configure the use of that by LemonEdge using MessageType, MessageConnectionString and MessageTopicForServerSync config settings

    Inherited Members
    IMessengerBase.CloseAsync()
    Namespace: LemonEdge.API.Messages
    Assembly: API.dll
    Syntax
    public interface IMessenger : IMessengerBase
    Remarks

    When you have more than one web or task service, the system needs to synchronise the cache between them all. This can be done by either a shared cache server they all connect to, or by passing messages that invalidate local caches.

    The performance between the two is a balance of the number of services being spun up and the general work load.

    This message interface is a simple mechanism to enable the web and task services to communicate with each other to keep everything in sync. Expanding this implementation allows you to use messages using other technologies than the Azure message bus (the default lemonedge messaging option)

    Methods

    Init(String, String)

    Initializes a new Messenger with the settings to connect to a message service and subscribe to a topic

    Declaration
    Task Init(string connectionString, string topicName)
    Parameters
    Type Name Description
    System.String connectionString

    The connection string for the message service

    System.String topicName

    The topic for messages

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task indicating the completion of the operation to connect to the message service

    SendMessageAsync(String)

    Sends the specified message to the connected message service and subscribed topic

    Declaration
    Task SendMessageAsync(string message)
    Parameters
    Type Name Description
    System.String message

    The message to send

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task indicating the completion of the operation

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)

    See Also

    IMessageListener
    MessageManagerFactory
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.