Esempio n. 1
0
        private Func<RogerEndpoint, IBasicProperties> CreatePropertiesFactory(IModel model,
            IIdGenerator idGenerator,
            IMessageTypeResolver messageTypeResolver,
            IMessageSerializer serializer,
            ISequenceGenerator sequenceGenerator)
        {
            var properties = model.CreateBasicProperties();

            properties.MessageId = idGenerator.Next();
            properties.Type = messageTypeResolver.Unresolve(messageType);
            properties.ContentType = serializer.ContentType;

            properties.Headers = new Hashtable
            {
                {Headers.Sequence, BitConverter.GetBytes(sequenceGenerator.Next(messageType))}
            };

            if (persistent)
                properties.DeliveryMode = 2;

            FillAdditionalProperties(properties, idGenerator);

            return endpoint =>
            {
                properties.ReplyTo = endpoint;
                return properties;
            };
        }
Esempio n. 2
0
        private Func <RogerEndpoint, IBasicProperties> CreatePropertiesFactory(IModel model,
                                                                               IIdGenerator idGenerator,
                                                                               IMessageTypeResolver messageTypeResolver,
                                                                               IMessageSerializer serializer,
                                                                               ISequenceGenerator sequenceGenerator)
        {
            var properties = model.CreateBasicProperties();

            properties.MessageId   = idGenerator.Next();
            properties.Type        = messageTypeResolver.Unresolve(messageType);
            properties.ContentType = serializer.ContentType;

            properties.Headers = new Hashtable();

            if (sequence)
            {
                properties.Headers[Headers.Sequence] = BitConverter.GetBytes(sequenceGenerator.Next(messageType));
            }

            if (persistent)
            {
                properties.DeliveryMode = 2;
            }

            FillAdditionalProperties(properties);

            return(endpoint =>
            {
                properties.ReplyTo = endpoint;
                return properties;
            });
        }
        public Task HandleAsync(OnCapitalBalanceChanged param)
        {
            BillingRecord billingRecord = new BillingRecord(
                _sequenceGenerator.Next("BR", new DateTimeSequenceAlgorithm()),
                param.AccountId,
                param.CapitalType,
                param.ChangedAmount,
                param.PayType,
                param.Desc,
                param.CardNo,
                param.BillingType,
                param.Balance);

            _billingRecordRepository.Insert(billingRecord);
            return(Task.FromResult(0));
        }
Esempio n. 4
0
 public string GenerateIdentify()
 {
     return(_sequenceGenerator.Next(SEQUENCE_NAME));
 }