Created
February 20, 2015 22:06
-
-
Save pablete/69960fde45b5d79f938b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Publish(IEnumerable<Reservation> reservations, out int nextWaterMark) | |
{ | |
nextWaterMark = 0; | |
using (IRabbitMqClient client = _clientFactory()) | |
{ | |
var channel = client.GetChannel(); | |
foreach (var reservation in reservations) | |
{ | |
string routingKey = GetRoutingKey(reservation); | |
string jsonReservation = SerializetoJson(reservation); | |
byte[] messageBodyBytes = System.Text.Encoding.UTF8.GetBytes(jsonReservation); | |
IBasicProperties props = GetBasicProperties(channel, routingKey, client.OtReservationExchange); | |
channel.BasicPublish(client.OtReservationExchange, routingKey, false, false, props, messageBodyBytes); | |
Analytics.Client.Track( | |
reservation.gpId, | |
"reservation_made", | |
SerializetoDict(reservation); | |
new Options().SetAnonymousId(anonymousId)); | |
ABclient.trackGoal(“reservation_made”, anonymousId); //anonymous unique visitor ID | |
nextWaterMark = reservation.reservationSequenceNumber; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment