Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 871487 Details for
Bug 1073491
C# client cannot send a map message containing some .NET types as dictionary values
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Reproducer
sender.cs (text/x-csharp), 5.34 KB, created by
Petra Svobodová
on 2014-03-06 14:30:01 UTC
(
hide
)
Description:
Reproducer
Filename:
MIME Type:
Creator:
Petra Svobodová
Created:
2014-03-06 14:30:01 UTC
Size:
5.34 KB
patch
obsolete
>/* > * > * Licensed to the Apache Software Foundation (ASF) under one > * or more contributor license agreements. See the NOTICE file > * distributed with this work for additional information > * regarding copyright ownership. The ASF licenses this file > * to you under the Apache License, Version 2.0 (the > * "License"); you may not use this file except in compliance > * with the License. You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, > * software distributed under the License is distributed on an > * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY > * KIND, either express or implied. See the License for the > * specific language governing permissions and limitations > * under the License. > * > */ > >using System; >using System.Collections.Generic; >using System.Collections.ObjectModel; >using Org.Apache.Qpid.Messaging; > >namespace Org.Apache.Qpid.Messaging.examples >{ > class MapSender > { > // csharp.map.sender example > // > // Send an amqp/map message to amqp:tcp:localhost:5672 amq.direct/map_example > // The map message contains simple types, a nested amqp/map, > // an ampq/list, and specific instances of each supported type. > // > static int Main(string[] args) > { > string url = "amqp:tcp:localhost:5672"; > string address = "message_queue; {create: always}"; > string connectionOptions = ""; > > if (args.Length > 0) > url = args[0]; > if (args.Length > 1) > address = args[1]; > if (args.Length > 2) > connectionOptions = args[2]; > > // > // Create and open an AMQP connection to the broker URL > // > Connection connection = new Connection(url, connectionOptions); > try > { > connection.Open(); > > // > // Create a session and a sender to the direct exchange > // > Session session = connection.CreateSession(); > Sender sender = session.CreateSender(address); > > // > // Create structured content for the message. This example builds a > // map of items including a nested map and a list of values. > // > Dictionary<string, object> content = new Dictionary<string, object>(); > > // add simple types > content["id"] = 987654321; > content["name"] = "Widget"; > content["percent"] = 0.99; > > // add a list > //Collection<object> colours = new Collection<object>(); //works > Collection<string> colours = new Collection<string>(); //fails > colours.Add("red"); > colours.Add("green"); > colours.Add("white"); > content["colours"] = colours; > > // add a dictionary (map) > Dictionary<string, double> dimensions = new Dictionary<string, double>(); // fails > //Dictionary<string, object> dimensions = new Dictionary<string, object>(); // works > dimensions["length"] = 10.2; > dimensions["width"] = 5.1; > dimensions["depth"] = 2.0; > content["dimensions"] = dimensions; > > // add a list of lists > Collection<object> parts = new Collection<object>(); > Collection<object> part1 = new Collection<object>(); > Collection<object> part2 = new Collection<object>(); > part1.Add(1); > part1.Add(2); > part1.Add(5); > part2.Add(8); > part2.Add(2); > part2.Add(5); > parts.Add(part1); > parts.Add(part2); > content["parts"] = parts; > > > // add a dictionary (map) with different types > Dictionary<string, object> specs = new Dictionary<string, object>(); > specs["colours"] = colours; > specs["dimensions"] = dimensions; > specs["parts"] = parts; > content["specs"] = specs; > > // add Guid type > Guid uuid = new Guid("669f44b3-92bf-4e89-836c-15fe87f6efba"); > content["uuid"] = uuid; > > // > // Construct a message with the map content and send it synchronously > // via the sender. > // > > > Message message = new Message(content); > //Console.ReadKey(); > sender.Send(message, true); > Console.WriteLine("{0}", message.AsString(content)); > > // > // Wait until broker receives all messages. > // > > session.Sync(); > > // > // Close the connection. > // > > connection.Close(); > return 0; > } > catch (Exception ex) > { > Console.WriteLine(ex.StackTrace); > if (connection != null) > { > connection.Close(); > } > return 1; > } > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1073491
: 871487