Trace Id is missing
February 23, 2022

Bosch delivers supply chain efficiencies using Java on Azure

Technical Story

The Internet of Things (IoT) experts at Bosch developed a solution that provides transparent supply chain logistics for everyone involved. Track and Trace is a smart Java-based solution that provides real-time information on the location of transported goods. Immediately popular and now meeting a growing demand, Track and Trace has moved to Azure—specifically, Azure Spring Apps, a fully managed service for running Spring Boot apps. Switching to a managed platform frees Bosch engineers from infrastructure maintenance so they can focus on what they do best and respond more quickly to customers. In addition, Azure provides end-to-end health metrics and insights that the team didn’t have before, making it significantly easier to operate this powerful, interconnected application.

Bosch

“We are Java developers. We are not infrastructure guys. We are not system administrators. With Azure Spring Apps, we don't have to worry about managing Kubernetes or cluster downtime.”

Philipp Stussak, Software Architect, Bosch

Tracking the supply chain across Germany and beyond

Bosch is an expert at harnessing the power of IoT to create smart solutions that improve people’s lives at home and work. As part of a tradition of precision engineering, Bosch designs, develops, and manages a wide range of IoT projects—from smart cities and smart appliances to smart cars and more.

Track and Trace is a case in point. When the COVID-19 pandemic disrupted supply chains, this solution became even more vital. Bosch developed Track and Trace a few years ago as a way to tag materials and to monitor the containers they’re shipped in, using IoT tech to give customers a clear, end-to-end view of the supply chain in all its complexity. The initial rollout in Germany moved into other parts of Europe and continues to expand.

“Track and Trace uses a lot of IoT devices, and we were looking ahead,” explains Georg Deschler, Senior Manager at Bosch. “We were asking what we needed to grow, how to scale better.”

Using sensors and GPS, Track and Trace helps customers keep track of environmental parameters that affect shipments—like temperature and humidity, in addition to location. Operators at Bosch plants use Track and Trace to locate assets along their supply chains. Companies like German industrial manufacturer TRUMPF and logistics company nox NightTimeExpress use the app to get real-time data about time-critical transports. This extra transparency helps them optimize operations. Assets are easier to find, container usage is more efficient, inventories are more accurate, and coordination of shipped goods goes more smoothly. (For details, see When Freight Writes Its Own Log on the Bosch website.)

“Scalability is important for us—from a business perspective, as well as technically,” Deschler adds. “We wanted to keep up with the expected growth.” A small team of IoT engineers began looking for some operational optimizations of its own.

Adopting managed services instead of maintaining infrastructure

As a longtime partner of Microsoft, Bosch asked for suggestions. When the Microsoft representative saw Spring applications in a Cloud Foundry environment, he suggested Azure Spring Apps—a platform as a service (PaaS) for Spring developers.

Azure Spring Apps features scalable components that make it simpler to run Java Spring applications while optimizing costs. With support for comprehensive monitoring and diagnostics, configuration management, continuous integration (CI) and continuous deployment (CD), life cycle management, and more, the platform offered the Bosch team PaaS benefits for deploying and managing its Spring Boot–based microservices.

At its core, Azure Spring Apps runs on Azure Kubernetes Service (AKS) and is designed to reduce the complexity and operational overhead of managing Kubernetes. “To scale our solution, we thought we'd have to dig deeper into Kubernetes and Docker, and we weren't into it,” Deschler admits.

Previously, the team used Jenkins to push projects to a Cloud Foundry environment and deploy Track and Trace. “When we heard about Azure Spring Apps, we saw that it would be a more than suitable stack for our Java apps. That became the base of our migration,” according to Deschler.

His colleague, Software Architect Philipp Stussak, agrees. “We are Java developers. We are not infrastructure guys. We are not system administrators. With Azure Spring Apps, we don't have to worry about managing Kubernetes or cluster downtime.” The team can simply deploy its Java fat JARs, much as before.

Azure Spring Apps also helped the small Track and Trace migration team meet its deadlines. “We wanted as few architectural changes as possible, because we wanted a very short migration,” Deschler explains. The plan was to move to Azure in just two months—an incredibly short time for a solution of this scale. “We made fast progress, but for us, the speed was really about scaling faster and reacting faster to changing requirements. Switching to Azure Spring Apps gave us that power.”

Migrating the Track and Trace microservices architecture

The Track and Trace workflow starts when a worker on a shop floor attaches a wireless tag to an asset. Using a mobile app, the worker can also create a logical link between an asset and a tag. The tag continuously broadcasts its ID to hardware gateways on site, which transfer the raw data to the core system running in Azure Spring Apps. There, the data is normalized and the business logic is added to translate raw data into meaningful information for the end customers.

(For more information, watch the Bosch video, End-to-end tracking along the supply chain via plug and play.)

Track and Trace includes 15 microservices that run on Azure Spring Apps. Most of these were creating using Spring Boot, but like any platform that has evolved over time, there were variations. Some of the microservices were developed using the Eclipse Vert.x event-driven framework.

“We couldn’t just expect the Vert.x stack to work on Azure Spring Apps,” Stussak recalls. “But it did, which was surprising to me!”

Happily so, as Deschler relates. “That was the sugar on top. We just had to fix a little of the configuration environment. In the end, this was the only thing I remember where we made adjustments.”

During the migration, the team followed the best practices outlined in the Azure Spring Apps reference architecture to ensure that microservices can easily communicate to other resources within Azure or at customer sites. On the ingestion side, Azure Application Gateway accepts incoming traffic from the devices and checks that requests are valid before routing them to Azure Spring Apps.

Data from devices is transmitted at a constant rate, so the team manually scales the number of virtual CPUs (vCPUs) and the amount of memory needed. Additionally, the Azure Spring Apps Autoscale feature helps applications perform their best when demand changes.

The migration also included 250 GB of relational data from an Oracle database, which the team moved in parallel to Azure SQL. “We wanted to keep to native Azure services whenever possible. Some might call it vendor lock-in, but for us it makes life easier,” Deschler points out. “It was the simplest solution in the end to switch and have just one responsibility and, on the other side, give Microsoft responsibility for the infrastructure.”

Stussak agrees. “We wanted the most cloud-native solutions, and that’s Azure SQL for us.”

On the customer end of the platform, Power BI delivers relevant information in the form of charts, dashboards, and reports. Bosch customers can also extend the Track and Trace data for use in their own systems. A publishing subsystem with a REST interface pushes events, status changes, and other notable data to customers’ existing enterprise systems.

Diagram of Azure Spring Apps Architecture
After moving the Bosch Track and Trace solution to Azure, Java Spring Boot applications run in Azure Spring Apps. Relational data is stored in Azure SQL Database. The solution provides meaningful, real-time data through Power BI and integration with customer ERP systems.

“The migration wouldn’t be finished by now if we’d had to deal with all the infrastructure that Azure Spring Apps handles for us.”

Philipp Stussak, Software Architect, Bosch

Monitoring a complex, distributed application

The decision to move to Azure Managed Services had an unexpected benefit that proved to be one of the best parts of the project, according to Deschler and Stussak. Azure Spring Apps, like all Azure services, works with Azure Monitor to keep teams informed about the health of their applications.

“In the past, we really didn't have very much information about the platform performance, or a good feeling for the scaling behavior, and so on,” Deschler reports.

For example, the team was able to detect and diagnose previously unknown bottlenecks. The team uses Application Insights to monitor application load, responsiveness, and the performance of dependencies. Deschler and Stussak both point to Application Map, a view that shows the full application topology across multiple levels of related components. They used it extensively after the migration to identify configuration and performance issues that they couldn’t find with their other tools.

“For us, it was eye-opening, because we didn't know things about our system that we know now through Application Insights and Azure Spring Apps,” Stussak reveals. Now the team uses Application Map to identify parts of the system to optimize. These are added to the backlog, where they can be prioritized for the next feature release.

Stussak recalls showing a stack trace on Azure Spring Apps to another team at Bosch. “They said wow because they can't do it at the moment with their stack. This is really cool because it saves a lot of time.”

“The monitoring functionalities in Application Insights are very valuable—not only to identify issues during daily operations but also to see which parts of the system we need to focus on to allow our business to grow.”

Georg Deschler, Senior Manager, Bosch

Flexing its IaC with Bicep

The team had its choice of tools to use in redoing its build pipelines. “As for the whole infrastructure abstraction layer, we didn’t want to waste time on build pipelines and deployment jobs,” Stussak points out. The team switched from Jenkins servers to Azure DevOps.

“We could use the existing out-of-the-box deployment tasks, which was nice for us,” Stussak notes. “We have customers asking for new features every day. We always look for ways to save time so we can work on that and invest in improving quality.”

Improving quality was top of mind throughout the project, and the goal was to automate as much as possible. Bosch uses Bicep templates to provision and configure Azure resources. As a domain-specific language (DSL), Bicep makes it easy for developers to create clean, reusable code for deploying Azure resources declaratively, and it’s easily understood at a glance.

“This solution had some complexity from the beginning, but with Bicep, all the integrations went well,” Deschler says. “It helped speed things up. The integration with Visual Studio Code was helpful, too.”

After testing Bicep for a week on its multiple environments, the team was sold. “Now we use Bicep and IaC to spin up all the environments automatically—and quite fast,” he adds.

A platform with the potential to grow

Bosch expects to add hundreds of thousands of devices to Track and Trace as adoption grows. Deschler and Stussak say they’re “very confident” that Azure can handle it.

As Deschler puts it, “We just see the potential to say, ‘OK, we can scale there.’ We are more confident that we can deal with that growth with Azure as we learn more about setting up multiregion capabilities. With the previous environment, we didn’t even have the option in that sense.”

Next up, the team plans to work on the backlog of optimizations and to continue to refine the strategy for a global footprint.

“We’re still finding out new things about Azure Spring Apps and the whole Azure stack,” Stussak concludes. “We were lucky to have the opportunity to move to the Azure environment. I promote Azure Spring Apps all the time to other teams at Bosch.”

“We were lucky to have the opportunity to move to the Azure environment. I promote Azure Spring Apps all the time to other teams at Bosch.”

Philipp Stussak, Software Architect, Bosch

Take the next step

Fuel innovation with Microsoft

Talk to an expert about custom solutions

Let us help you create customized solutions and achieve your unique business goals.

Drive results with proven solutions

Achieve more with the products and solutions that helped our customers reach their goals.

Follow Microsoft