Se hai cliccato lascia un TUO commento nel muro della vergogna
This file contains 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
let stream = TcpStream::connect((broker.host.as_str(), broker.port)).await?; | |
let mut tls_builder: tokio_native_tls::native_tls::TlsConnectorBuilder = tokio_native_tls::native_tls::TlsConnector::builder(); | |
let cert_bytes = include_bytes!("result/ca_certificate.pem"); | |
let cert = Certificate::from_pem(cert_bytes).unwrap(); | |
let s = tls_builder.add_root_certificate(cert) | |
.danger_accept_invalid_hostnames(false) | |
// .danger_accept_invalid_certs(true) | |
.min_protocol_version(Some(tokio_native_tls::native_tls::Protocol::Tlsv12)); | |
let conn = tokio_native_tls::TlsConnector::from(s.build()?).connect(broker.host.as_str(), stream).await?; |
This file contains 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
import json | |
import time | |
from json import JSONEncoder | |
class Foo: | |
def __init__(self, string_1, string_2, int_1): | |
self.string_1 = string_1 | |
self.string_1 = string_2 | |
self.int_1 = int_1 |
- L'applicatione gira su Azure
- Una app mobile manda dei dati tramite rest API ad una App Service
- L'app service poi salva su rabbitmq ( ma questo non e importante)
Problema:
- Gestire l'autenticazione dato che l'end poit HTTP è pubblico
- Solo l'app puo fare upload
- l'app NON deve fare nessuna registrazione di username e password da nessuna parte ( se interessati vi spiego il perche)
- Non conosco Azure e non sono un esperto di mobile
This file contains 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
using System.Text; | |
using RabbitMQ.Stream.Client; | |
using RabbitMQ.Stream.Client.Reliable; | |
namespace example; | |
public class Batch | |
{ | |
private const int TotalMessages = 20_000_000; | |
private const int MessageSize = 100; | |
private const int AggregateBatchSize = 300; |
Stream queues are divided into two sections:
This file contains 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
TODO: | |
- Move it to github | |
- Create unit tests | |
- Create a CI to execute the tests with github action |
NewerOlder