Skip to content

Commit

Permalink
Merge pull request #1827 from MoellJ/main
Browse files Browse the repository at this point in the history
Fixed Markdown formatting issue with html character entities
  • Loading branch information
michaelklishin committed Mar 7, 2024
2 parents e90d26e + 03e2697 commit a363028
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion tutorials/tutorial-five-dotnet.md
Expand Up @@ -166,7 +166,7 @@ channel.ExchangeDeclare(exchange: "topic_logs", type: ExchangeType.Topic);
// declare a server-named queue
var queueName = channel.QueueDeclare().QueueName;

if (args.Length < 1)
if (args.Length < 1)
{
Console.Error.WriteLine("Usage: {0} [binding_key...]",
Environment.GetCommandLineArgs()[0]);
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-five-elixir.md
Expand Up @@ -172,7 +172,7 @@ if length(System.argv) == 0 do
IO.puts "Usage: mix run receive_logs_topic.exs [binding_key]..."
System.halt(1)
end
for binding_key &lt;- System.argv do
for binding_key <- System.argv do
AMQP.Queue.bind(channel, queue_name, "topic_logs", routing_key: binding_key)
end

Expand Down
8 changes: 4 additions & 4 deletions tutorials/tutorial-five-go.md
Expand Up @@ -186,7 +186,7 @@ func main() {

func bodyFrom(args []string) string {
var s string
if (len(args) &lt; 3) || os.Args[2] == "" {
if (len(args) < 3) || os.Args[2] == "" {
s = "hello"
} else {
s = strings.Join(args[2:], " ")
Expand All @@ -196,7 +196,7 @@ func bodyFrom(args []string) string {

func severityFrom(args []string) string {
var s string
if (len(args) &lt; 2) || os.Args[1] == "" {
if (len(args) < 2) || os.Args[1] == "" {
s = "anonymous.info"
} else {
s = os.Args[1]
Expand Down Expand Up @@ -253,7 +253,7 @@ func main() {
)
failOnError(err, "Failed to declare a queue")

if len(os.Args) &lt; 2 {
if len(os.Args) < 2 {
log.Printf("Usage: %s [binding_key]...", os.Args[0])
os.Exit(0)
}
Expand Down Expand Up @@ -289,7 +289,7 @@ func main() {
}()

log.Printf(" [*] Waiting for logs. To exit press CTRL+C")
&lt;-forever
<-forever
}
```

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-five-java.md
Expand Up @@ -176,7 +176,7 @@ public class ReceiveLogsTopic {
channel.exchangeDeclare(EXCHANGE_NAME, "topic");
String queueName = channel.queueDeclare().getQueue();

if (argv.length &lt; 1) {
if (argv.length < 1) {
System.err.println("Usage: ReceiveLogsTopic [binding_key]...");
System.exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-four-dotnet.md
Expand Up @@ -212,7 +212,7 @@ channel.ExchangeDeclare(exchange: "direct_logs", type: ExchangeType.Direct);
// declare a server-named queue
var queueName = channel.QueueDeclare().QueueName;

if (args.Length &lt; 1)
if (args.Length < 1)
{
Console.Error.WriteLine("Usage: {0} [info] [warning] [error]",
Environment.GetCommandLineArgs()[0]);
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tutorial-four-elixir.md
Expand Up @@ -144,7 +144,7 @@ we're interested in.
```elixir
{:ok, %{queue: queue_name}} = AMQP.Queue.declare(channel, "", exclusive: true)

for {severity, true} &lt;- severities do
for {severity, true} <- severities do
binding_key = severity |> to_string
AMQP.Queue.bind(channel, queue_name, "direct_logs", routing_key: binding_key)
end
Expand Down Expand Up @@ -180,7 +180,7 @@ message =

AMQP.Exchange.declare(channel, "direct_logs", :direct)

for {severity, true} &lt;- severities do
for {severity, true} <- severities do
severity = severity |> to_string
AMQP.Basic.publish(channel, "direct_logs", severity, message)
IO.puts " [x] Sent '[#{severity}] #{message}'"
Expand Down Expand Up @@ -217,7 +217,7 @@ AMQP.Exchange.declare(channel, "direct_logs", :direct)

{:ok, %{queue: queue_name}} = AMQP.Queue.declare(channel, "", exclusive: true)

for {severity, true} &lt;- severities do
for {severity, true} <- severities do
binding_key = severity |> to_string
AMQP.Queue.bind(channel, queue_name, "direct_logs", routing_key: binding_key)
end
Expand Down
10 changes: 5 additions & 5 deletions tutorials/tutorial-four-go.md
Expand Up @@ -193,7 +193,7 @@ q, err := ch.QueueDeclare(
)
failOnError(err, "Failed to declare a queue")

if len(os.Args) &lt; 2 {
if len(os.Args) < 2 {
log.Printf("Usage: %s [info] [warning] [error]", os.Args[0])
os.Exit(0)
}
Expand Down Expand Up @@ -277,7 +277,7 @@ func main() {

func bodyFrom(args []string) string {
var s string
if (len(args) &lt; 3) || os.Args[2] == "" {
if (len(args) < 3) || os.Args[2] == "" {
s = "hello"
} else {
s = strings.Join(args[2:], " ")
Expand All @@ -287,7 +287,7 @@ func bodyFrom(args []string) string {

func severityFrom(args []string) string {
var s string
if (len(args) &lt; 2) || os.Args[1] == "" {
if (len(args) < 2) || os.Args[1] == "" {
s = "info"
} else {
s = os.Args[1]
Expand Down Expand Up @@ -344,7 +344,7 @@ func main() {
)
failOnError(err, "Failed to declare a queue")

if len(os.Args) &lt; 2 {
if len(os.Args) < 2 {
log.Printf("Usage: %s [info] [warning] [error]", os.Args[0])
os.Exit(0)
}
Expand Down Expand Up @@ -380,7 +380,7 @@ func main() {
}()

log.Printf(" [*] Waiting for logs. To exit press CTRL+C")
&lt;-forever
<-forever
}
```

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-four-java.md
Expand Up @@ -203,7 +203,7 @@ public class ReceiveLogsDirect {
channel.exchangeDeclare(EXCHANGE_NAME, "direct");
String queueName = channel.queueDeclare().getQueue();

if (argv.length &lt; 1) {
if (argv.length < 1) {
System.err.println("Usage: ReceiveLogsDirect [info] [warning] [error]");
System.exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-one-go.md
Expand Up @@ -250,7 +250,7 @@ go func() {
}()

log.Printf(" [*] Waiting for messages. To exit press CTRL+C")
&lt;-forever
<-forever
```

[Here's the whole receive.go script](https://github.com/rabbitmq/rabbitmq-tutorials/blob/main/go/receive.go).
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tutorial-seven-dotnet.md
Expand Up @@ -177,7 +177,7 @@ sample that uses a dictionary to correlate the publishing sequence number
with the string body of the message:

```csharp
var outstandingConfirms = new ConcurrentDictionary&lt;ulong, string&gt;();
var outstandingConfirms = new ConcurrentDictionary<ulong, string>();
// ... code for confirm callbacks will come later
var body = "...";
outstandingConfirms.TryAdd(channel.NextPublishSeqNo, body);
Expand All @@ -189,13 +189,13 @@ to clean this dictionary when confirms arrive and do something like logging a wa
when messages are nack-ed:

```csharp
var outstandingConfirms = new ConcurrentDictionary&lt;ulong, string&gt;();
var outstandingConfirms = new ConcurrentDictionary<ulong, string>();

void CleanOutstandingConfirms(ulong sequenceNumber, bool multiple)
{
if (multiple)
{
var confirmed = outstandingConfirms.Where(k =&gt; k.Key &lt;= sequenceNumber);
var confirmed = outstandingConfirms.Where(k => k.Key <= sequenceNumber);
foreach (var entry in confirmed)
{
outstandingConfirms.TryRemove(entry.Key, out _);
Expand Down
4 changes: 2 additions & 2 deletions tutorials/tutorial-seven-java.md
Expand Up @@ -182,10 +182,10 @@ to clean this map when confirms arrive and do something like logging a warning
when messages are nack-ed:

```java
ConcurrentNavigableMap<Long, String&gt; outstandingConfirms = new ConcurrentSkipListMap<&gt;();
ConcurrentNavigableMap<Long, String> outstandingConfirms = new ConcurrentSkipListMap<>();
ConfirmCallback cleanOutstandingConfirms = (sequenceNumber, multiple) -> {
if (multiple) {
ConcurrentNavigableMap<Long, String&gt; confirmed = outstandingConfirms.headMap(
ConcurrentNavigableMap<Long, String> confirmed = outstandingConfirms.headMap(
sequenceNumber, true
);
confirmed.clear();
Expand Down
8 changes: 4 additions & 4 deletions tutorials/tutorial-six-dotnet.md
Expand Up @@ -277,7 +277,7 @@ public class RpcClient : IDisposable
private readonly IConnection connection;
private readonly IModel channel;
private readonly string replyQueueName;
private readonly ConcurrentDictionary&lt;string, TaskCompletionSource&lt;string>> callbackMapper = new();
private readonly ConcurrentDictionary<string, TaskCompletionSource<string>> callbackMapper = new();

public RpcClient()
{
Expand All @@ -302,14 +302,14 @@ public class RpcClient : IDisposable
autoAck: true);
}

public Task&lt;string&gt; CallAsync(string message, CancellationToken cancellationToken = default)
public Task<string>; CallAsync(string message, CancellationToken cancellationToken = default)
{
IBasicProperties props = channel.CreateBasicProperties();
var correlationId = Guid.NewGuid().ToString();
props.CorrelationId = correlationId;
props.ReplyTo = replyQueueName;
var messageBytes = Encoding.UTF8.GetBytes(message);
var tcs = new TaskCompletionSource&lt;string&gt;();
var tcs = new TaskCompletionSource<string>();
callbackMapper.TryAdd(correlationId, tcs);

channel.BasicPublish(exchange: string.Empty,
Expand All @@ -332,7 +332,7 @@ public class Rpc
public static async Task Main(string[] args)
{
Console.WriteLine("RPC Client");
string n = args.Length &gt; 0 ? args[0] : "30";
string n = args.Length > 0 ? args[0] : "30";
await InvokeAsync(n);

Console.WriteLine(" Press [enter] to exit.");
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tutorial-six-go.md
Expand Up @@ -273,7 +273,7 @@ func main() {
}()

log.Printf(" [*] Awaiting RPC requests")
&lt;-forever
<-forever
}
```

Expand Down Expand Up @@ -313,7 +313,7 @@ func failOnError(err error, msg string) {

func randomString(l int) string {
bytes := make([]byte, l)
for i := 0; i &lt; l; i++ {
for i := 0; i < l; i++ {
bytes[i] = byte(randInt(65, 90))
}
return string(bytes)
Expand Down Expand Up @@ -396,7 +396,7 @@ func main() {

func bodyFrom(args []string) int {
var s string
if (len(args) &lt; 2) || os.Args[1] == "" {
if (len(args) < 2) || os.Args[1] == "" {
s = "30"
} else {
s = strings.Join(args[1:], " ")
Expand Down
4 changes: 2 additions & 2 deletions tutorials/tutorial-three-go.md
Expand Up @@ -307,7 +307,7 @@ func main() {

func bodyFrom(args []string) string {
var s string
if (len(args) &lt; 2) || os.Args[1] == "" {
if (len(args) < 2) || os.Args[1] == "" {
s = "hello"
} else {
s = strings.Join(args[1:], " ")
Expand Down Expand Up @@ -401,7 +401,7 @@ func main() {
}()

log.Printf(" [*] Waiting for logs. To exit press CTRL+C")
&lt;-forever
<-forever
}
```

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-three-java.md
Expand Up @@ -207,7 +207,7 @@ public class EmitLog {
Channel channel = connection.createChannel()) {
channel.exchangeDeclare(EXCHANGE_NAME, "fanout");

String message = argv.length &lt; 1 ? "info: Hello World!" :
String message = argv.length < 1 ? "info: Hello World!" :
String.join(" ", argv);

channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes("UTF-8"));
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-three-spring-amqp.md
Expand Up @@ -294,7 +294,7 @@ public class Tut3Sender {
if (dots.getAndIncrement() == 3) {
dots.set(1);
}
for (int i = 0; i &lt; dots.get(); i++) {
for (int i = 0; i < dots.get(); i++) {
builder.append('.');
}
builder.append(count.incrementAndGet());
Expand Down
10 changes: 5 additions & 5 deletions tutorials/tutorial-two-go.md
Expand Up @@ -89,7 +89,7 @@ Here is the `bodyFrom` function:
```go
func bodyFrom(args []string) string {
var s string
if (len(args) &lt; 2) || os.Args[1] == "" {
if (len(args) < 2) || os.Args[1] == "" {
s = "hello"
} else {
s = strings.Join(args[1:], " ")
Expand Down Expand Up @@ -127,7 +127,7 @@ go func() {
}()

log.Printf(" [*] Waiting for messages. To exit press CTRL+C")
&lt;-forever
<-forever
```

Note that our fake task simulates execution time.
Expand Down Expand Up @@ -266,7 +266,7 @@ go func() {
}()

log.Printf(" [*] Waiting for messages. To exit press CTRL+C")
&lt;-forever
<-forever
```

Using this code, you can ensure that even if you terminate a worker using
Expand Down Expand Up @@ -476,7 +476,7 @@ func main() {

func bodyFrom(args []string) string {
var s string
if (len(args) &lt; 2) || os.Args[1] == "" {
if (len(args) < 2) || os.Args[1] == "" {
s = "hello"
} else {
s = strings.Join(args[1:], " ")
Expand Down Expand Up @@ -557,7 +557,7 @@ func main() {
}()

log.Printf(" [*] Waiting for messages. To exit press CTRL+C")
&lt;-forever
<-forever
}
```

Expand Down

0 comments on commit a363028

Please sign in to comment.