rest – Which message pattern should I use for synchronous communincation in Nodejs Microservices?

My Nodejs microservices currently running on Kubernetes are communicating over REST. Does the request-reply model of NATS, which replier needs to return (large data ~ 500kb currently single endpoint response), cause performance increase? Some benchmarks say it’s 10 times faster (1), but I got a bad result on a little test I did at my local (but the conditions weren’t equal, I’ll repeat the test on more equal terms). On the other hand, I have read that RabbitMQ does not have a good performance on request-reply. I want to discuss here, how can I decide which communication model is advantageous / performance in situations that require synchronous communication?

In addition, when REST is used, resources can be documented with Swagger. What needs to be done when using NATS?

  1. https://www.youtube.com/watch?v=JNQM_aq9pd4&ab_channel=VinothSelvaraj
  2. https://www.vinsguru.com/nats-performance-comparison-with-rest/

Board Message

Sorry, an error occurred. If you are unsure on how to use a feature, or don’t know why you got this error message, try looking through the help files for more information.

The error returned was:

You must register a free account with us and stay logged in to see this forum.

Post, Read around and Network with the Like-Minded Money Makers.

Expand your Network and Start Making Some New Friends!

DTM Network – A Social Money Making Network where People from all over the World Meet, Share Ideas and Grow as a TEAM!

Register an account here now to view the full forum and enjoy all the benefit for free.

Use the form below to log in if you already have an account.

Google Groups “Spam message handling” Setting Won’t Stay Set

I have a free Google Groups group setup and messages (which are being forwarded from a Gmail account) keep going into the Pending moderation queue. I’ve repeatedly attempted to change the “Spam message handling” setting (only visible when you click “Advanced settings”) to “Post suspicious messages to the group”, but every time I refresh the settings page it’s reverted back to “Moderate and notify content moderators”.

Is there a way to actually change this setting and allow these messages through?

forms – Sending Message Information via XmlHttpRequest or Ajax

Please bare with me as I am new to web programming and have spent a long time trying to figure this out on my own. I am using node.js with express and am attempting to send data from my client to the server in order to send an email from a “Contact Me” page.

My simple test html form is this:

<form action="email" method="POST" class="contact-form">
  <input type="text" id="name" placeholder="Your Name" value="Test">
  <input type="email" id="email" placeholder="Your Email" value="Bob@bob.com">
  <input type="text" id="subject" placeholder="Subject" value="Subject of Email">
  <textarea cols="30" rows="7" id="message" placeholder="Message" >I was here.</textarea>
  <input type="submit" value="Send Message" class="submit">
</form>

This is the code for my server using XMLHttpRequest:

const contactForm = document.querySelector(".contact-form");
let name    = document.getElementById("name");
let email   = document.getElementById("email");
let subject = document.getElementById("subject");
let message = document.getElementById("message");

contactForm.addEventListener("submit", (e) => {
e.preventDefault();

let formData = {
  name: name.value,
  email: email.value,
  subject: subject.value,
  message: message.value
}

let xhr = new XMLHttpRequest();
xhr.open("POST", "/");
xhr.setRequestHeader("content-type", "application/json");
xhr.onload = function() {
console.log(xhr.responseText); //This never runs
if(xhr.responseText == "success") {
  alert("Email sent"); //this never fires
  name.value = "";
  email.value = "";
  subject.value = "";
  message.value = "";
} else {
  alert("Something went wrong!"); //nor does this
}

  console.log(xhr.statusText); //nor does this
  xhr.send(JSON.stringify(formData));
}

});

I also have the exact same thing using ajax here.

const contactForm = document.querySelector(".contact-form");
let name    = document.getElementById("name");
let email   = document.getElementById("email");
let subject = document.getElementById("subject");
let message = document.getElementById("message");

contactForm.addEventListener("submit", (e) => {
  e.preventDefault();

  let formData = {
    name: name.value,
    email: email.value,
    subject: subject.value,
    message: message.value
  }

  $.ajax({
    type: 'POST',
    url: "/",
    contentType: "application/json; charset=utf-8",
    datatype: 'json',
    data: formData,
    success: function (response) {
        console.log(response);
    },
    error: function(error) {
        console.log("error");
    }
 });

});

For both cases, my server side code is this:

const express = require("express");
const app = express();

const PORT = process.env.PORT || 3000;

//Middleware
app.use(express.static("public"));

app.get("/", function(req, res) {
    //send html file. Do this so that other code can run.
    res.sendFile(__dirname + "/contactform.html");
});

app.post("/", function(req, res) {
     var data = JSON.parse(req.body)
     console.log(data);
  });
  

app.listen(PORT, function(req, res) {
    console.log('Listening on port ${PORT}');
});

My XMLHttpRequest version does not run the onload code. The ajax version returns a 500 internal server error and the data sent is undefined.

Any help would be appreciated.

mac – Message is extreemly slow to open Big Sur

mac – Message is extreemly slow to open Big Sur – Ask Different

REST API is protected by HMAC based authentication. What does including URL path in the message protect from?

I have came across a REST API for some commercial software, that checks authentication by requiring HMAC on concatenation of

  • http_method (GET, PUT, etc)
  • timestamp
  • payload (body of a POST / PUT request if any)
  • path (everything between https://domain.tld and the first question mark)

This HMAC then is passed in a request header.

What does this scheme protect against by including the path?

magento2 – When I select categoy menu or any page I get following error message “Exception printing is disabled by default for security reasons” Magento 2.4

magento2 – When I select categoy menu or any page I get following error message “Exception printing is disabled by default for security reasons” Magento 2.4 – Magento Stack Exchange

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123