Giter Club home page Giter Club logo

fsharp.cloudagent's Introduction

fsharp.cloudagent's People

Contributors

chrsteinert avatar dsyme avatar fsprojectsgit avatar hussam avatar isaacabraham avatar sergey-tihon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsharp.cloudagent's Issues

Batch message posting

Currently you must post messages to pools one at a time. There should be the option to provide a set of messages that can be posted in a batch.

Support Topics and Subscriptions

Subscriptions are the bomb

In contrast to queues, in which each message is processed by a single consumer, topics and subscriptions provide a one-to-many form of communication, in a “publish/subscribe” pattern. Useful for scaling to very large numbers of recipients, each published message is made available to each subscription registered with the topic. Messages are sent to a topic and delivered to one or more associated subscriptions, depending on filter rules that can be set on a per-subscription basis. The subscriptions can use additional filters to restrict the messages that they want to receive. Messages are sent to a topic in the same way they are sent to a queue, but messages are not received from the topic directly. Instead, they are received from subscriptions. A topic subscription resembles a virtual queue that receives copies of the messages that are sent to the topic. Messages are received from a subscription identically to the way they are received from a queue.

By way of comparison, the message-sending functionality of a queue maps directly to a topic and its message-receiving functionality maps to a subscription

Messages exist in queue but are not received when listening

I'm able to add messages to the queue but when I try to receive them nothing is received.

I've used the Azure Service Bus in linqpad with C# sample code so I know the queue works, but I'm probably missing something on the F# implementation with CloudAgent.

I tried serializing the object before adding it to the queue so that the content would just be a string that I could deserialize on receipt, but still had the same issue.

If I set a breakpoint on the line inbox.Receive() it gets hit, but a breakpoint on the following line never does.

Thanks for the help.

I'm not sure if it'd be more helpful to put the code in this issue or point you to my project so here are both.
https://github.com/talbottmike/TalBot/tree/AzureServiceBus

The type I'm posting is in TalBot.Types...

type IncomingMessage = 
    {
        token : string;
        teamId : string;
        teamDomain : string;
        channelId : string;
        channelName : string;
        timestamp : decimal;
        userId : string;
        userName : string;
        text : string;
        triggerWord : string;
    }

I'm accessing the queue in TalBot.BotHelper around the beginning of the module.

let createResilientAgent agentId =
    MailboxProcessor.Start(fun inbox ->
        async {
            while true do
                let! message, replyChannel = inbox.Receive()
                printfn "%s is the channelName." message.channelName
                printfn "%s" (agentId.ToString())

                match message with
                | { channelName = "#bot-log" } -> 
                    printfn "success"
                    replyChannel Completed // all good, message was processed
                | { channelName = "snapple" } -> 
                    printfn "snapple failed"
                    replyChannel Failed // error occurred, try again
                | _ -> 
                    printfn "abandoned"
                    replyChannel Abandoned // give up with this message.
        })

let readFromServiceQueue () =
    let serviceBusReadConnection () = ServiceBusConnection serviceBusReadConnectionString
    let cloudReadConnection () = WorkerCloudConnection(serviceBusReadConnection (), Queue "queue")
    printfn "trying to read from the queue"
    let disposable = ConnectionFactory.StartListening(cloudReadConnection (), createResilientAgent >> Messaging.CloudAgentKind.ResilientCloudAgent)
    disposable.Dispose()    

Allow arbitrary message lock extension

On long running tasks it is necessary to extend visibility timeouts to prevent them being incorrectly redelivered.

To achieve this you need either the CloudQueueMessage in scope, or the MessageId or SequenceNumber and also LockToken in order to use raw REST API.

via .NET client you'd do this:
https://msdn.microsoft.com/en-us/library/azure/microsoft.windowsazure.storage.queue.cloudqueue.updatemessage.aspx

via REST you'd do this:
https://msdn.microsoft.com/en-us/library/azure/jj839746.aspx

Since the CloudAgent paradigm abstracts away some of these details, a long running agent will incorrectly have the same message delivered multiple times.

It could be that a "ReplyChannel Extend" type operation is a relevant solution.

Better configurability

There is already support under-the-hood for different serializers as well as controlling the number of agents in worker pools, but this is currently not surfaced to the caller.

feature request - support for Service Bus for Windows

"Service Bus for Windows Server is a set of installable components that provides the messaging capabilities of Windows Azure Service Bus on Windows. Service Bus for Windows Server enables you to build, test, and run loosely-coupled, message-driven applications in self-managed environments and on developer computers. Service Bus queues offer reliable message storage and retrieval with a choice of protocols and APIs. Building on the same foundation as queues, Service Bus topics provide rich publish/subscribe capabilities that allow multiple, concurrent subscribers to independently retrieve filtered or unfiltered views of the published message stream." http://msdn.microsoft.com/en-us/library/dn282144.aspx

NOTE: There may be minor incompatibilities between the DLL versions used by Windows and Asure - see: https://code.msdn.microsoft.com/windowsapps/service-bus-explorer-f2abca5a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.