1

I have been searching and reading the Rad Server docs. I have even emailed tech support with out much help, but I am trying to find a way to version my resources (end points) in the Embarcadero Rad Server.

We are running Rad Server 10.3.1 and EMS server in Apache on a Windows server.

We are starting to have breaking changes in our end points and need newer versions of our applications to access newer versions of the API, while having older versions of the apps access older versions. I have tried to setup something like

https://www.example.com/api/V1/scheduler_appointments
https://www.example.com/api/V2/scheduler_appointments

However, when I start the apache server, it complains about

"Exception":"EPackageError","Message":"Cannot load package 'MyBPL.'"

And it complains about the "Used" units as already contained in the first package.

Has anybody been able to run multiple versions of their BPL resource files in Rad Server? Thanks

KenDavis
  • 47
  • 5
  • Hmmm, never created two different bpl files with the same unit names in it. Are the bpl filenames different? Is so, thn you’re best of giving the unit names a version specifier like ‘api.xyz.v2.unit1’ and the ref units using ‘unit1’ and then add unit name prefixes to the project. – R. Hoek Sep 01 '20 at 20:27
  • @R.Hoek - yeah, they would be different. But, the shared unit's are the same version so they have the same filename - and that is where I was hitting the issue. – KenDavis Sep 04 '20 at 15:11
  • This is a usual problem when working with bpl-files. You must put the shared units into a separate package/bpl and then link to the shared bpl to make it work... – R. Hoek Sep 04 '20 at 18:52

1 Answers1

1

One way could be to include both modules in the same BPL.

unit Unit1;
type
  [ResourceName('v1')]
  TVResource1 = class(TDataModule)

unit Unit2;
type
  [ResourceName('v2')]
  TVResource2 = class(TDataModule)
FMXExpress
  • 1,246
  • 8
  • 10
  • That is an interesting thought. That does mean I would have to have duplicates of every single endpoint, even if they didn't change, right? – KenDavis Sep 04 '20 at 15:13
  • Yeah, but you will have to do that anyway? Even if you had 2 BPLs v1 and v2 would be totally separate APIs because the root is /v1 and /v2. Also you could just call the version 1 code from the version 2 endpoint for things that didn't change. – FMXExpress Sep 05 '20 at 22:20