Skip to content

Adding RaiseEvent to client for scalability, Allow creating queue with specific size - #70

Merged
Simon Porter (simonporter) merged 8 commits into
Azure:vnextfrom
matthawley:users/matthaw/raiseevent
Dec 3, 2016
Merged

Adding RaiseEvent to client for scalability, Allow creating queue with specific size#70
Simon Porter (simonporter) merged 8 commits into
Azure:vnextfrom
matthawley:users/matthaw/raiseevent

Conversation

@matthawley

Copy link
Copy Markdown
Contributor

A common pattern for long-running orchestrations is to create an orchestration then raise an event on it. This causes twice as many messages to service bus. This change will do this process in a batch send.

@matthawleyMatt Hawley (matthawley) changed the title Adding RaiseEvent to client for scalabilityAdding RaiseEvent to client for scalability, Allow creating queue with specific sizeNov 17, 2016
@matthawley

Copy link
Copy Markdown
ContributorAuthor

I also added ability to set the maximum service bus queue size (issue #68)

@matthawley

Copy link
Copy Markdown
ContributorAuthor

Also fixed issue #73 which was throwing a null ref exception when a work item was aborted.

await SafeCreateQueueAsync(namespaceManager, path, requiresSessions, requiresDuplicateDetection, maxDeliveryCount, maxSizeInMegabytes);
}

private static readonly long[] ValidQueueSizes = { 1024L, 2048L, 3072L, 4096L, 5120L };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convention is to not include modifier for private

var executionStartedEvent = message.Event as ExecutionStartedEvent;
if (executionStartedEvent != null)
var brokeredMessages = new BrokeredMessage[messages.Length];
for (int i = 0; i < messages.Length; i++)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetBrokeredMessageFromObjectAsync could end up going to blob storage or another slow external storage so running this as tasks would be better so the latency is not sequential.


/// <summary>
/// Maximum queue size, in megabytes, for the service bus queues
/// </summary>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1024L as default for consistency with the valid sizes list

/// <param name="orchestrationVersion">Name of the orchestration as specified by the ObjectCreator</param>
/// <param name="instanceId">Instance id for the orchestration to be created, must be unique across the Task Hub</param>
/// <param name="eventName">Name of the event</param>
/// <param name="eventData">Data for the event</param>

@simonporterSimon Porter (simonporter)Dec 1, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the naming of RaiseEventAsync here is a bit confusing as the meaning for an already running instance is quite different.
I think it would be better to have a CreateOrchestrationInstanceWithRaisedEventAsync (open to other naming suggestions) and have the various permutations for with/without tags etc.
Likely best to have an InternalCreateOrchestrationInstanceAsync that this and the CreateOrchestrationInstanceAsync can call to avoid duplication.

@simonporter
Simon Porter (simonporter) merged commit 3b903f2 into Azure:vnextDec 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@matthawley@simonporter