private ChunkingMessage GetNewChunkingMessage(Message receivedMessage, TimeoutHelper timeoutHelper)
		{
			if (receivedMessage == null)
			{
				return null;
			}
			Guid messageId = this.GetMessageId(receivedMessage);
			if (this.currentInputMessage != null && messageId == this.currentInputMessage.MessageId)
			{
				throw new InvalidOperationException("A new ChunkingMessage was requested but the received message's id matches the current message id. The received message is a chunk of the current message");
			}
			ChunkingReader reader = new ChunkingReader(receivedMessage, this.maxBufferedChunks, timeoutHelper);
			string header = receivedMessage.Headers.GetHeader<string>("OriginalAction", "http://bam.nexon.com/chunking");
			ChunkingMessage chunkingMessage = new ChunkingMessage(receivedMessage.Version, header, reader, messageId);
			string addressingNamespace = ChunkingUtils.GetAddressingNamespace(receivedMessage.Version);
			for (int i = 0; i < receivedMessage.Headers.Count; i++)
			{
				MessageHeaderInfo messageHeaderInfo = receivedMessage.Headers[i];
				if (messageHeaderInfo.Namespace != "http://bam.nexon.com/chunking" && (!(messageHeaderInfo.Name == "Action") || !(messageHeaderInfo.Namespace == addressingNamespace)))
				{
					chunkingMessage.Headers.CopyHeaderFrom(receivedMessage.Headers, i);
				}
			}
			return chunkingMessage;
		}
Exemplo n.º 2
0
 internal ChunkingMessage(MessageVersion version, string action, ChunkingReader reader, Guid messageId)
 {
     this.version        = version;
     this.chunkReader    = reader;
     this.properties     = new MessageProperties();
     this.headers        = new MessageHeaders(this.version);
     this.headers.Action = action;
     this.messageId      = messageId;
 }