Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support to GTFS-RT #58

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Altonhe
Copy link
Member

@Altonhe Altonhe commented Mar 10, 2024

As #44 mentioned, this PR add GTFS-RT support to docker, The user can use docker-compose to quickly set up an instance, you can start with follow docker-compose.yml

...
  oba_app:
    container_name: oba_app
    depends_on:
      - oba_database
    build:
      context: ./oba
      # For test only, remove in production
      args:
        - TEST_API_KEY=test
        - VEHICLE_POSITIONS_URL=http://gtfs.ltconline.ca/Vehicle/VehiclePositions.pb
        - TRIP_UPDATES_URL=http://gtfs.ltconline.ca/TripUpdate/TripUpdates.pb
        - ALERTS_URL=http://gtfs.ltconline.ca/Alert/Alerts.pb
        - REFRESH_INTERVAL=30
        - AGENCY_ID=ltc
    environment:
      - JDBC_URL=jdbc:mysql://oba_database:3306/oba_database
      - JDBC_USER=oba_user
      - JDBC_PASSWORD=oba_password
    volumes:
      # Share the host's `bundle` directory
      # with the filesystem of the OBA service.
      - ./bundle:/bundle
    ports:
      # Access the webapp on your host machine at a path like
      # http://localhost:8080/onebusaway-api-webapp/api/where/agency/${YOUR_AGENCY}.json?key=TEST
      - "8080:8080"
    # restart: always
...

Results:
In docker oba_app:

$ cat /usr/local/tomcat/webapps/onebusaway-transit-data-federation-webapp/WEB-INF/classes/data-sources.xml
...
<!--    GTFS-RT related beans, automatically generated by the `bootstrap.sh`-->
<bean id="gtfsRT" class="org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource">
  <property name="tripUpdatesUrl" value="http://gtfs.ltconline.ca/TripUpdate/TripUpdates.pb"/>
  <property name="vehiclePositionsUrl" value="http://gtfs.ltconline.ca/Vehicle/VehiclePositions.pb"/>
  <property name="alertsUrl" value="http://gtfs.ltconline.ca/Alert/Alerts.pb"/>
  <property name="refreshInterval" value="30"/>
  <property name="agencyId" value="ltc"/>
</bean>
<bean id="bundleManagementService" class="org.onebusaway.transit_data_federation.impl.bundle.BundleManagementServiceImpl">
  <property name="bundleStoreRoot" value="/bundle"/>
  <property name="standaloneMode" value="true"/>
</bean>
...

image

@Altonhe Altonhe marked this pull request as ready for review March 10, 2024 20:18
Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per our conversation, looks like there's some investigation to do around realtime trip updates/vehicle positions. Alerts is working great!

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and works perfectly!

@aaronbrethorst aaronbrethorst merged commit cfffb6b into OneBusAway:main Mar 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants