Best Of
Re: Solace Python API on Mac M1 ?
Just a friendly ping that the latest version of the Python API has been released (v. 1.7.0) with support for Mac M-series processors. It should be slowly rolling out in different places and is already available via PyPI (
)Thanks again for all your patience!
Re: java.lang.ClassCastException: Solace QueueProxy cannot be cast to Weblogic DestinationImpl
UPDATE:
I tried a bunch to get this to work but unfortunately couldn't. So I finally decided to just forego this Message Driven Bean approach and reworked the whole thing by simply implementing a Message Listener in the class file. And whaddya know the simplest solution is the one that works.
This is the modified code:
package main; //<Imports here> public class TopicConsumer implements MessageListener {
private ConnectionFactory connectionFactory;
private Connection connection;
private Session session;
private MessageConsumer messageConsumer;
private final String CONNECTION_FACTORY_JNDI_NAME = "JNDI/J2C/CF";
TopicConsumer() throws InterruptedException {
initialize();
}
@Override
public void onMessage(Message message) {
try {
if (message instanceof TextMessage) {
System.out.printf("TextMessage received: '%s'%n", ((TextMessage) message).getText());
} else {
System.out.println("Message received.");
System.out.printf("Message Content:%n%s%n", SolJmsUtility.dumpMessage(message));
}
// ACK the received message manually because of the set SupportedProperty.SOL_CLIENT_ACKNOWLEDGE above
message.acknowledge();
} catch (JMSException ex) {
System.out.println("Error processing incoming message.");
ex.printStackTrace();
}
}
public void initialize() throws InterruptedException {
try {
Hashtable<String, Object> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
InitialContext initialContext = new InitialContext(env);
connectionFactory = (ConnectionFactory) initialContext.lookup(CONNECTION_FACTORY_JNDI_NAME);
System.out.println("Connection Factory " + connectionFactory + " established");
connection = connectionFactory.createConnection();
System.out.println("Connection " + connection + " created");
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createQueue("MyQueue");
messageConsumer = session.createConsumer(queue);
messageConsumer.setMessageListener(this);
connection.start();
System.out.println("Awaiting message...");
} catch (NamingException | JMSException e) {
e.printStackTrace();
}
finally {
try{
connection.stop();
messageConsumer.close();
session.close();
connection.close();
} catch (Exception e) {
System.err.println("Error sending message: " + e.getMessage());
e.printStackTrace();
}
}
} }
Similar to the case with my producer code I directly gave the actual destination name instead of doing a JNDI lookup while creating the Queue. I don't know why i tried to make it extra complicated with the MDB.
Anyways hope this helps anyone else facing the issue. Cheers !!
Quick-and-dirty REST server for RDP testing
Hi there! I thought I'd share a (possibly!) useful snippet of code that you can use to receive REST requests, and respond with a canned body. It's in Node. I don't know Node, so apologies if it's not glamourous code. I was inspired by the "Simple REST Consumer" on this tutorial: https://solace.com/samples/solace-samples-rest-messaging/publish-subscribe/
Update the variable RC_HOST
at the top of the file with your machine's IP address. Don't use localhost
, use the actual IP address. Note, if using WSL2, you'll need to use the "internal" address of the virtual machine. On my Windows machine, I run this from the Ubuntu shell, so my IP address looks like 172.28.123.115
.
And if running the PubSub+ broker locally, inside your RDP Rest Consumer, you can't use "localhost" or "127.0.0.1" when testing with an RDP, because the Solace broker has it's own networking setup. You'll have to specify your actual IP address, or whatever you started the server with.
Anyhow, copy this into a file, and then simply run node NodeServer.js
% cat NodeServer.js var http = require('http'); var RC_PORT = 9090; //var RC_HOST = '127.0.0.1'; // only works from browser, not RDP //var RC_HOST = '10.1.1.245'; // home var RC_HOST = '192.168.42.194'; // office LAN http.createServer(function (req, res) { let date_ob = new Date(); var dateStr = date_ob.getHours()+':'+date_ob.getMinutes()+':'+date_ob.getSeconds(); //console.log(req); // all the details of this request console.log('Received message: ' + req.method + " " + req.url + ' at ' + dateStr); Object.keys(req.headers).forEach(function(key) { //if (!key.startsWith('solace')) return; var val = req.headers[key]; console.log(' HEAD:' + key + ' = ' + val); }); let body = []; req.on('data', (chunk) => { body.push(chunk); }).on('end', () => { body = Buffer.concat(body).toString(); // at this point, `body` has the entire request body stored in it as a string console.log(' BODY: '+ body); }); // RESPONSE TIME! //res.writeHead(200); // bytes message res.writeHead(200, { 'Content-Type': 'text/plain' }); // text message res.write("Hello world from Aaron's test HTTP server!"); res.end(); //console.log(res); }).listen(RC_PORT,RC_HOST); // good to go! console.log('Server running at http://'+RC_HOST+':'+RC_PORT+'/');
When you send a request, it will dump stuff out to the console. Here's a quick test from Chrome, loading http://192.168.42.194:9090/hello/world
:
Server running at http://192.168.42.194:9090/ Received message: GET /hello/world at 15:0:48 HEAD:host = 192.168.42.194:9090 HEAD:connection = keep-alive HEAD:upgrade-insecure-requests = 1 HEAD:user-agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 HEAD:accept = text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 HEAD:accept-encoding = gzip, deflate HEAD:accept-language = en-GB,en-US;q=0.9,en;q=0.8 BODY:
Have fun playing with RDPs and Solace+REST!
New Graphical Designer in Event Portal
Hi all,
📣 We are pleased to announce the availability of the new graphical designer in Event Portal. This feature is being delivered in phases, with this first phase providing a graphical view of the event driven architecture for each of your application domains.
⭐️ The graph displays the latest, non-retired version of each application and event in the application domain, and shows the intended pub/sub relationships between them, as well as the relationships with events and apps in other application domains. As you drag objects around in the graph to customize the view, if you have Editor level access or higher, the changes are automatically saved and can be viewed by other users who can access the app domain. You can also double-click on an application or event icon in the graph to view or edit the details of the object.
⭐️ Check out this video for a demo of this new feature and what we are planning to add to it next.
✅ Stay tuned for those upcoming enhancements!
Introductions Thread - New to the community? Start here!
Intro
Hi all, if you've joined recently you may have seen a welcome message from me in your inbox but I figured a great way to get to know folks here would be an intro thread. As we share Solace related knowledge and learn from each other, let's get to know each other!
Name or handle
(only share what you're comfortable with of course)
In real life I'm Trish Mermuys and you can find me on twitter @mermuys and LinkedIn if you want to connect with me there.
Location
Where in the world is...
I'm in Ottawa, Canada. Right now I'm working from home but normally I'm at Solace's headquarters here in Ottawa.
Job
I'm currently the Developer Content and Community Manager here at Solace. My job is to help make this community a thriving place where you can find other people who are as passionate, interested, and curious about Solace, PubSub+, Event Portal, and really anything related to event driven architecture.
For fun
Tell us about the fun story about your experience with Solace
For me it's not directly related to Solace software or the broker, but starting a new job in the midst of a pandemic. I had worked remotely before, but it was temporary (six months) and with a team of people that I already knew quite well and had great rapport with. I started with Solace in May when everything was pretty much shut down here in Ottawa. So I didn't get to meet any of my coworkers in person until last week. We just had restaurant outdoor patios open recently so I was able to join @hong and @Tamimi for some drinks and food and finally see them in real life! It was a great moment to get to know them even better, plus the beer tasted really good!
Now it's your turn! Comment below👇 and tell us a bit about yourself!
New blog post for developers | The Importance of Event Governance in EDA
Distributed Tracing is now Generally Available!
I'm thrilled to announce that Distributed Tracing is now generally available for all customers and prospects. The recent release of PubSub+ 10.2.0 included distributed tracing!
Thanks to all the customers who tried out our early access release of distributed tracing! Our Early Access release of distributed tracing is now complete! We had a record-breaking number of customers asking for this early access release! Thanks again!
If you would like to continue to experience distributed tracing for free, you still can! Distributed tracing in demo mode is available for current and trial customers in 10.2.0! Check it out!
Solace Distributed Tracing is an amazing new capability that pulls back the curtain and lets you understand on an event-by-event basis what is happening to your events as they traverse through the event mesh. It unites the event mesh with the observability tools used today with application performance monitoring and HTTP/REST messaging! Ultimately, it will provide full visibility of your events as they traverse clients & the event mesh for debugging, troubleshooting, event mesh analytics, performance analysis, audit, governance, and non-repudiation among other use cases. We expect to deliver wave upon wave of new distributed tracing capability over the coming releases.
Speaking of which, keep your eyes out for the upcoming early access release of Distributed Tracing with Context Propagation! This time it will be available on Solace Cloud too! Coming soon!
Keep handling those events,
Rob Tomkins
Core Product Manager
New blog post for developers | PubSub+ Event Portal Application for Confluence
Solace PubSub+ Event Portal offers a range of features and capabilities that support the management and governance of event-driven architecture (EDA) throughout the software development lifecycle (SDLC). From event discovery and documentation to versioning, collaboration, and integration with development tools with its Cloud REST APIs, Event Portal helps teams streamline the development and maintenance of EDA, ensuring consistency and effective communication across the organization.
Leave your comments below.
Aaron's Office Hours: Partitioned Queues! (round 2)
This month's Office Hours is "Round 2" for our look at Solace Partitioned Queues, where they will really get put to the test! Solace developer advocate Aaron Lee will be joined by Edward Funnekotter from Solace HQ, one of Solace's top engineers and architects. They will be presenting an open-source demo showing off how Partitioned Queues function, trying out different settings, and explaining various aspects of guaranteed messaging in general. Be sure to mark your calendars for August 22nd for this fun, interactive deep-dive!
LinkedIn - Solace Office Hours - August 2023
As always, they'll be answering questions live on-air, so make sure to tune into the livestream, or post your questions in advance right here in this thread!
Query Solace PubSub+ Cloud using SQL with Steampipe
Introducing Steampipe
Steampipe is an open-source tool that has redefined the way developers interact with cloud infrastructure. Breaking the barriers of traditional approaches, Steampipe empowers you to query Cloud REST APIs using the timeless language of SQL.
With Steampipe, you can now leverage the familiarity and efficiency of SQL to effortlessly explore and interact with cloud resources from various providers like AWS, Azure, Google Cloud Platform, and more. Steampipe streamlines your cloud data exploration by providing a centralized hub to query, visualize, and manage cloud resources.
Now, with Solace PubSub+ Cloud plugin for Steampipe, enhance your experience with the perfect blend of Solace PubSub+ Cloud and Steampipe's SQL magic!
Solace PubSub+ Cloud plugin for Steampipe
The Solace PubSub+ Cloud plugin is available in the Steampipe’s plugin registry
The Go-lang code serving the plugin are available on the GitHub.
Go-lang SDK for Solace PubSub+ Cloud REST APIs
Source code of Solace PubSub+ Cloud plugin
Feel free to check it out, and do share your feedback and suggestions for improvement here.
Getting Started
- Install Steampipe CLI
Follow the instructions on the Steampipe CLI downloads page and install the tool corresponding to your OS.
2. Install Solace PubSub+ Cloud plugin
Run the following command in the terminal or command prompt.
steampipe plugin install solacelabs/solace
3. Get an API Token for PubSub+ Cloud REST APIs
Solace PubSub+ Cloud plugin requires an API Token. You can find more details on how to generate an API Token here – t Your PubSub+ Cloud REST API token.
4. Configure API Token & API URL on the plugin
The generated token should be set as value for api_token parameter in the plugin config file (~/.steampipe/config/solace.spc). If you are working with AU region, be sure to update the api_url parameter appropriately.
connection "solace" { # Get your API key from https://console.solace.cloud/api-tokens # This can also be set via the `SOLACE_API_TOKEN` environment variable. api_token = "XXXXXXXXX" # The API URL. By default it is pointed to "https://api.solace.cloud/" # If working with the AU region , use "https://api.solacecloud.com.au/" # This can also be set via the `SOLACE_API_URL` environment variable. api_url = "https://api.solace.cloud/" }
plugin = "SolaceLabs/solace"
Query Solace PubSub+ Cloud
Launch Steampipe CLI Tool
steampipe query
Start issuing queries on the tables.
Steampipe's seamless integration with Solace PubSub+ Cloud can allow us to harness the power of SQL to effortlessly interact with cloud resources, making querying PubSub+ Cloud a breeze. The combination of Steampipe's SQL-based querying and Solace PubSub+ Cloud's API can open new avenues for data-driven decisions with newfound efficiency.
So, let's embrace the magic of SQL and Solace PubSub+ Cloud and explore new avenues of opportunities. Let's make every query count!